diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 73392c0..0000000 --- a/.editorconfig +++ /dev/null @@ -1,250 +0,0 @@ -# Remove the line below if you want to inherit .editorconfig settings from higher directories -root = true - -[*] -insert_final_newline = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 -indent_size = 4 -end_of_line = crlf -dotnet_style_coalesce_expression = true:suggestion -dotnet_style_null_propagation = true:suggestion -dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion -dotnet_style_prefer_auto_properties = true:suggestion -dotnet_style_object_initializer = true:suggestion -dotnet_style_collection_initializer = true:suggestion -dotnet_style_prefer_simplified_boolean_expressions = true:suggestion -dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion -dotnet_style_prefer_conditional_expression_over_return = true:suggestion -dotnet_style_explicit_tuple_names = true:suggestion -dotnet_style_prefer_inferred_tuple_names = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion -dotnet_style_prefer_compound_assignment = true:suggestion -dotnet_style_prefer_simplified_interpolation = true:suggestion -dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion -dotnet_style_namespace_match_folder = true:suggestion - -# C# files -[*.cs] - -#### Core EditorConfig Options #### - -# Indentation and spacing -indent_size = 4 -indent_style = space -tab_width = 4 - -# New line preferences -end_of_line = crlf - -#### .NET Coding Conventions #### - -# Organize usings -dotnet_separate_import_directive_groups = false -dotnet_sort_system_directives_first = false -file_header_template = unset - -# this. and Me. preferences -dotnet_style_qualification_for_event = false:suggestion -dotnet_style_qualification_for_field = false -dotnet_style_qualification_for_method = false:suggestion -dotnet_style_qualification_for_property = false:suggestion - -# Language keywords vs BCL types preferences -dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion -dotnet_style_predefined_type_for_member_access = true:suggestion - -# Parentheses preferences -dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion -dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:suggestion -dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion -dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion - -# Modifier preferences -dotnet_style_require_accessibility_modifiers = for_non_interface_members - -# Expression-level preferences -dotnet_style_coalesce_expression = true -dotnet_style_collection_initializer = true -dotnet_style_explicit_tuple_names = true -dotnet_style_namespace_match_folder = true -dotnet_style_null_propagation = true -dotnet_style_object_initializer = true -dotnet_style_operator_placement_when_wrapping = beginning_of_line -dotnet_style_prefer_auto_properties = true:suggestion -dotnet_style_prefer_compound_assignment = true -dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion -dotnet_style_prefer_conditional_expression_over_return = true:suggestion -dotnet_style_prefer_inferred_anonymous_type_member_names = true -dotnet_style_prefer_inferred_tuple_names = true -dotnet_style_prefer_is_null_check_over_reference_equality_method = true -dotnet_style_prefer_simplified_boolean_expressions = true -dotnet_style_prefer_simplified_interpolation = true - -# Field preferences -dotnet_style_readonly_field = true - -# Parameter preferences -dotnet_code_quality_unused_parameters = all - -# Suppression preferences -dotnet_remove_unnecessary_suppression_exclusions = none - -# New line preferences -dotnet_style_allow_multiple_blank_lines_experimental = true:suggestion -dotnet_style_allow_statement_immediately_after_block_experimental = true - -#### C# Coding Conventions #### - -# var preferences -csharp_style_var_elsewhere = true:suggestion -csharp_style_var_for_built_in_types = false:suggestion -csharp_style_var_when_type_is_apparent = true:suggestion - -# Expression-bodied members -csharp_style_expression_bodied_accessors = true:suggestion -csharp_style_expression_bodied_constructors = true:suggestion -csharp_style_expression_bodied_indexers = true:suggestion -csharp_style_expression_bodied_lambdas = true:suggestion -csharp_style_expression_bodied_local_functions = true:suggestion -csharp_style_expression_bodied_methods = true:suggestion -csharp_style_expression_bodied_operators = true:suggestion -csharp_style_expression_bodied_properties = true:suggestion - -# Pattern matching preferences -csharp_style_pattern_matching_over_as_with_null_check = true -csharp_style_pattern_matching_over_is_with_cast_check = true -csharp_style_prefer_extended_property_pattern = true -csharp_style_prefer_not_pattern = true -csharp_style_prefer_pattern_matching = true:suggestion -csharp_style_prefer_switch_expression = true - -# Null-checking preferences -csharp_style_conditional_delegate_call = true -csharp_style_prefer_parameter_null_checking = true - -# Modifier preferences -csharp_prefer_static_local_function = true -csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async - -# Code-block preferences -csharp_prefer_braces = when_multiline:suggestion -csharp_prefer_simple_using_statement = true:suggestion -csharp_style_namespace_declarations = file_scoped:warning -csharp_style_prefer_method_group_conversion = true:silent - -# Expression-level preferences -csharp_prefer_simple_default_expression = true -csharp_style_deconstructed_variable_declaration = true -csharp_style_implicit_object_creation_when_type_is_apparent = true -csharp_style_inlined_variable_declaration = true -csharp_style_prefer_index_operator = true -csharp_style_prefer_local_over_anonymous_function = true -csharp_style_prefer_null_check_over_type_check = true -csharp_style_prefer_range_operator = true -csharp_style_prefer_tuple_swap = true -csharp_style_throw_expression = true -csharp_style_unused_value_assignment_preference = discard_variable -csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion - -# 'using' directive preferences -csharp_using_directive_placement = outside_namespace:suggestion - -# New line preferences -csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false:suggestion -csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false:suggestion -csharp_style_allow_embedded_statements_on_same_line_experimental = true - -#### C# Formatting Rules #### - -# New line preferences -csharp_new_line_before_catch = true -csharp_new_line_before_else = true -csharp_new_line_before_finally = true -csharp_new_line_before_members_in_anonymous_types = true -csharp_new_line_before_members_in_object_initializers = true -csharp_new_line_before_open_brace = all -csharp_new_line_between_query_expression_clauses = true - -# Indentation preferences -csharp_indent_block_contents = true -csharp_indent_braces = false -csharp_indent_case_contents = true -csharp_indent_case_contents_when_block = true -csharp_indent_labels = one_less_than_current -csharp_indent_switch_labels = true - -# Space preferences -csharp_space_after_cast = false -csharp_space_after_colon_in_inheritance_clause = true -csharp_space_after_comma = true -csharp_space_after_dot = false -csharp_space_after_keywords_in_control_flow_statements = true -csharp_space_after_semicolon_in_for_statement = true -csharp_space_around_binary_operators = before_and_after -csharp_space_around_declaration_statements = false -csharp_space_before_colon_in_inheritance_clause = true -csharp_space_before_comma = false -csharp_space_before_dot = false -csharp_space_before_open_square_brackets = false -csharp_space_before_semicolon_in_for_statement = false -csharp_space_between_empty_square_brackets = false -csharp_space_between_method_call_empty_parameter_list_parentheses = false -csharp_space_between_method_call_name_and_opening_parenthesis = false -csharp_space_between_method_call_parameter_list_parentheses = false -csharp_space_between_method_declaration_empty_parameter_list_parentheses = false -csharp_space_between_method_declaration_name_and_open_parenthesis = false -csharp_space_between_method_declaration_parameter_list_parentheses = false -csharp_space_between_parentheses = false -csharp_space_between_square_brackets = false - -# Wrapping preferences -csharp_preserve_single_line_blocks = true -csharp_preserve_single_line_statements = true - -#### Naming styles #### - -# Naming rules - -dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion -dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface -dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i - -dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.types_should_be_pascal_case.symbols = types -dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case - -dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion -dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members -dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case - -# Symbol specifications - -dotnet_naming_symbols.interface.applicable_kinds = interface -dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = - -dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum -dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = - -dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method -dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = - -# Naming styles - -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = -dotnet_naming_style.pascal_case.capitalization = pascal_case - -dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = -dotnet_naming_style.begins_with_i.capitalization = pascal_case -csharp_style_prefer_top_level_statements = true:silent -csharp_style_prefer_primary_constructors = true:suggestion - -# RCS1123: Add parentheses when necessary -dotnet_diagnostic.RCS1123.severity = none diff --git a/GlobalSuppressions.cs b/GlobalSuppressions.cs index 2790a95..42d5ede 100644 --- a/GlobalSuppressions.cs +++ b/GlobalSuppressions.cs @@ -7,16 +7,16 @@ "CA1812:Avoid uninstantiated internal classes", Justification = "Unneeded spam", Scope = "namespaceanddescendants", - Target = "~N:EcoCode.LiveWarnings")] + Target = "~N:RuleTests")] [assembly: SuppressMessage("Performance", "CA1852:Seal internal types", Justification = "Unneeded spam", Scope = "namespaceanddescendants", - Target = "~N:EcoCode.LiveWarnings")] + Target = "~N:RuleTests")] [assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unneeded spam", Scope = "namespaceanddescendants", - Target = "~N:EcoCode.LiveWarnings")] + Target = "~N:RuleTests")] diff --git a/src/EC69.DontCallFunctionsInLoopConditions.cs b/RuleTests/EcoCode/EC69.DontCallFunctionsInLoopConditions.cs similarity index 95% rename from src/EC69.DontCallFunctionsInLoopConditions.cs rename to RuleTests/EcoCode/EC69.DontCallFunctionsInLoopConditions.cs index 61bc76f..d32f738 100644 --- a/src/EC69.DontCallFunctionsInLoopConditions.cs +++ b/RuleTests/EcoCode/EC69.DontCallFunctionsInLoopConditions.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class DontCallFunctionsInLoopConditions { diff --git a/src/EC72.DontExecuteSqlCommandsInLoops.cs b/RuleTests/EcoCode/EC72.DontExecuteSqlCommandsInLoops.cs similarity index 95% rename from src/EC72.DontExecuteSqlCommandsInLoops.cs rename to RuleTests/EcoCode/EC72.DontExecuteSqlCommandsInLoops.cs index 3ef5fc8..cea4fd6 100644 --- a/src/EC72.DontExecuteSqlCommandsInLoops.cs +++ b/RuleTests/EcoCode/EC72.DontExecuteSqlCommandsInLoops.cs @@ -1,6 +1,6 @@ using System.Data; -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class DontExecuteSqlCommandsInLoops { diff --git a/src/EC75.DontConcatenateStringsInLoops.cs b/RuleTests/EcoCode/EC75.DontConcatenateStringsInLoops.cs similarity index 99% rename from src/EC75.DontConcatenateStringsInLoops.cs rename to RuleTests/EcoCode/EC75.DontConcatenateStringsInLoops.cs index aa0016d..83e0e1a 100644 --- a/src/EC75.DontConcatenateStringsInLoops.cs +++ b/RuleTests/EcoCode/EC75.DontConcatenateStringsInLoops.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class DontConcatenateStringsInLoops { diff --git a/src/EC81.SpecifyStructLayout.cs b/RuleTests/EcoCode/EC81.SpecifyStructLayout.cs similarity index 96% rename from src/EC81.SpecifyStructLayout.cs rename to RuleTests/EcoCode/EC81.SpecifyStructLayout.cs index c0f340a..a03818c 100644 --- a/src/EC81.SpecifyStructLayout.cs +++ b/RuleTests/EcoCode/EC81.SpecifyStructLayout.cs @@ -1,6 +1,6 @@ using System.Runtime.InteropServices; -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class SpecifyStructLayout { diff --git a/src/EC82.VariableCanBeMadeConstant.cs b/RuleTests/EcoCode/EC82.VariableCanBeMadeConstant.cs similarity index 96% rename from src/EC82.VariableCanBeMadeConstant.cs rename to RuleTests/EcoCode/EC82.VariableCanBeMadeConstant.cs index c86e2ce..462fb1a 100644 --- a/src/EC82.VariableCanBeMadeConstant.cs +++ b/RuleTests/EcoCode/EC82.VariableCanBeMadeConstant.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class VariableCanBeMadeConstant { diff --git a/src/EC83.ReplaceEnumToStringWithNameOf.cs b/RuleTests/EcoCode/EC83.ReplaceEnumToStringWithNameOf.cs similarity index 97% rename from src/EC83.ReplaceEnumToStringWithNameOf.cs rename to RuleTests/EcoCode/EC83.ReplaceEnumToStringWithNameOf.cs index bf6e67e..5123308 100644 --- a/src/EC83.ReplaceEnumToStringWithNameOf.cs +++ b/RuleTests/EcoCode/EC83.ReplaceEnumToStringWithNameOf.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class ReplaceEnumToStringWithNameOf { diff --git a/src/EC84.AvoidAsyncVoidMethods.cs b/RuleTests/EcoCode/EC84.AvoidAsyncVoidMethods.cs similarity index 95% rename from src/EC84.AvoidAsyncVoidMethods.cs rename to RuleTests/EcoCode/EC84.AvoidAsyncVoidMethods.cs index 13aa940..e999d5d 100644 --- a/src/EC84.AvoidAsyncVoidMethods.cs +++ b/RuleTests/EcoCode/EC84.AvoidAsyncVoidMethods.cs @@ -1,6 +1,6 @@ using System.Net.Http; -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class AvoidAsyncVoidMethods { diff --git a/src/EC85.MakeTypeSealed.cs b/RuleTests/EcoCode/EC85.MakeTypeSealed.cs similarity index 97% rename from src/EC85.MakeTypeSealed.cs rename to RuleTests/EcoCode/EC85.MakeTypeSealed.cs index 9abd5f8..d864c91 100644 --- a/src/EC85.MakeTypeSealed.cs +++ b/RuleTests/EcoCode/EC85.MakeTypeSealed.cs @@ -1,6 +1,8 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; -// Because EC85 is a compiler warning, it will only appear in the error list after a compilation, but not in the editor. +// Because EC85 is a compiler warning, it can't appear live in the editor. +// It can appear in the Error List after a compilation or after using 'Run Code Analysis', +// but only if the option 'all' is set in the .csproj file. internal static class MakeTypeSealed { @@ -165,7 +167,7 @@ public class TestA2 { internal virtual void Method() { } } // EC85: make type se public class TestA3 { protected virtual void Method() { } } public class TestA4 { protected internal virtual void Method() { } } // EC85: make type sealed public class TestA5 { private protected virtual void Method() { } } // EC85: make type sealed - + internal class TestB1 { public virtual void Method() { } } // EC85: make type sealed internal class TestB2 { internal virtual void Method() { } } // EC85: make type sealed internal class TestB3 { protected virtual void Method() { } } // EC85: make type sealed @@ -186,13 +188,13 @@ public class TestA2 { internal virtual void Method() { } } // EC85: make type se public class TestA3 { protected virtual void Method() { } } // EC85: make type sealed public class TestA4 { protected internal virtual void Method() { } } // EC85: make type sealed public class TestA5 { private protected virtual void Method() { } } // EC85: make type sealed - + internal class TestB1 { public virtual void Method() { } } // EC85: make type sealed internal class TestB2 { internal virtual void Method() { } } // EC85: make type sealed internal class TestB3 { protected virtual void Method() { } } // EC85: make type sealed internal class TestB4 { protected internal virtual void Method() { } } // EC85: make type sealed internal class TestB5 { private protected virtual void Method() { } } // EC85: make type sealed - + private class TestC1 { public virtual void Method() { } } // EC85: make type sealed private class TestC2 { internal virtual void Method() { } } // EC85: make type sealed private class TestC3 { protected virtual void Method() { } } // EC85: make type sealed diff --git a/src/EC86.GCCollectShouldNotBeCalled.cs b/RuleTests/EcoCode/EC86.GCCollectShouldNotBeCalled.cs similarity index 88% rename from src/EC86.GCCollectShouldNotBeCalled.cs rename to RuleTests/EcoCode/EC86.GCCollectShouldNotBeCalled.cs index a44e394..1d79f26 100644 --- a/src/EC86.GCCollectShouldNotBeCalled.cs +++ b/RuleTests/EcoCode/EC86.GCCollectShouldNotBeCalled.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class GCCollectShouldNotBeCalled { @@ -7,8 +7,8 @@ public static void Run() // GC.Collect(); GC.Collect(); // EC86 - - System.GC.Collect(); // EC86 + + GC.Collect(); // EC86 GC.Collect(0); diff --git a/src/EC87.UseListIndexer.cs b/RuleTests/EcoCode/EC87.UseListIndexer.cs similarity index 98% rename from src/EC87.UseListIndexer.cs rename to RuleTests/EcoCode/EC87.UseListIndexer.cs index 3633b24..401e127 100644 --- a/src/EC87.UseListIndexer.cs +++ b/RuleTests/EcoCode/EC87.UseListIndexer.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class UseListIndexer { diff --git a/src/EC88.DisposeResourceAsynchronusly.cs b/RuleTests/EcoCode/EC88.DisposeResourceAsynchronusly.cs similarity index 97% rename from src/EC88.DisposeResourceAsynchronusly.cs rename to RuleTests/EcoCode/EC88.DisposeResourceAsynchronusly.cs index 72ddc11..0667c2f 100644 --- a/src/EC88.DisposeResourceAsynchronusly.cs +++ b/RuleTests/EcoCode/EC88.DisposeResourceAsynchronusly.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; [SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Valid warning but we don't need it here")] internal static class DisposeResourceAsynchronusly diff --git a/src/EC91.UseWhereBeforeOrderBy.cs b/RuleTests/EcoCode/EC91.UseWhereBeforeOrderBy.cs similarity index 96% rename from src/EC91.UseWhereBeforeOrderBy.cs rename to RuleTests/EcoCode/EC91.UseWhereBeforeOrderBy.cs index 9cfee8d..0f08142 100644 --- a/src/EC91.UseWhereBeforeOrderBy.cs +++ b/RuleTests/EcoCode/EC91.UseWhereBeforeOrderBy.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class UseWhereBeforeOrderBy { diff --git a/RuleTests/EcoCode/EC92.UseLengthToTestEmptyStrings.cs b/RuleTests/EcoCode/EC92.UseLengthToTestEmptyStrings.cs new file mode 100644 index 0000000..73e3826 --- /dev/null +++ b/RuleTests/EcoCode/EC92.UseLengthToTestEmptyStrings.cs @@ -0,0 +1,12 @@ +namespace RuleTests.EcoCode; + +internal static class UseLengthToTestEmpyString +{ + public static void Test(string s) + { + if (s == "") // EC92 + { + Console.WriteLine("Empty"); + } + } +} diff --git a/src/EC93.ReturnTaskDirectly.cs b/RuleTests/EcoCode/EC93.ReturnTaskDirectly.cs similarity index 97% rename from src/EC93.ReturnTaskDirectly.cs rename to RuleTests/EcoCode/EC93.ReturnTaskDirectly.cs index 2911e7c..a6a0e0d 100644 --- a/src/EC93.ReturnTaskDirectly.cs +++ b/RuleTests/EcoCode/EC93.ReturnTaskDirectly.cs @@ -1,4 +1,4 @@ -namespace EcoCode.LiveWarnings; +namespace RuleTests.EcoCode; internal static class ReturnTaskDirectly { diff --git a/RuleTests/Roslyn/CA1001.TypesThatOwnDisposableFieldsShouldBeDisposable.cs b/RuleTests/Roslyn/CA1001.TypesThatOwnDisposableFieldsShouldBeDisposable.cs new file mode 100644 index 0000000..01ac315 --- /dev/null +++ b/RuleTests/Roslyn/CA1001.TypesThatOwnDisposableFieldsShouldBeDisposable.cs @@ -0,0 +1,10 @@ +using System.IO; + +namespace RuleTests.Roslyn; + +public sealed class TypesThatOwnDisposableFieldsShouldBeDisposable // CA1001 +{ + private readonly MemoryStream _shouldBeDisposed = new(); + + public void Test() => _shouldBeDisposed.Position = 0; +} diff --git a/RuleTests/Roslyn/CA1802.UseLiteralsWhereAppropriate.cs b/RuleTests/Roslyn/CA1802.UseLiteralsWhereAppropriate.cs new file mode 100644 index 0000000..ba80051 --- /dev/null +++ b/RuleTests/Roslyn/CA1802.UseLiteralsWhereAppropriate.cs @@ -0,0 +1,8 @@ +namespace RuleTests.Roslyn; + +public static class UseLiteralsWhereAppropriate +{ + private static readonly string MyStr = "ShouldBeConst"; // CA1802 + + public static void Print() => Console.WriteLine(MyStr); +} diff --git a/RuleTests/Roslyn/CA1805.DoNotInitializeUnnecessarily.cs b/RuleTests/Roslyn/CA1805.DoNotInitializeUnnecessarily.cs new file mode 100644 index 0000000..e17d280 --- /dev/null +++ b/RuleTests/Roslyn/CA1805.DoNotInitializeUnnecessarily.cs @@ -0,0 +1,8 @@ +namespace RuleTests.Roslyn; + +public sealed class DoNotInitializeUnnecessarily +{ + public int MyInt { get; } = 0; // CA1805 + + public string? MyStr { get; } = null; // CA1805 +} diff --git a/RuleTests/Roslyn/CA1813.AvoidUnsealedAttributes.cs b/RuleTests/Roslyn/CA1813.AvoidUnsealedAttributes.cs new file mode 100644 index 0000000..0416640 --- /dev/null +++ b/RuleTests/Roslyn/CA1813.AvoidUnsealedAttributes.cs @@ -0,0 +1,6 @@ +namespace RuleTests.Roslyn; + +[AttributeUsage(AttributeTargets.Class)] +public class UnsealedAttribute : Attribute // CA1813 +{ +} diff --git a/RuleTests/Roslyn/CA1816.CallGcSuppressFinalizeCorrectly.cs b/RuleTests/Roslyn/CA1816.CallGcSuppressFinalizeCorrectly.cs new file mode 100644 index 0000000..7981e8d --- /dev/null +++ b/RuleTests/Roslyn/CA1816.CallGcSuppressFinalizeCorrectly.cs @@ -0,0 +1,30 @@ +namespace RuleTests.Roslyn; + +public static class CallGcSuppressFinalizeCorrectly +{ + // In an unsealed class, a method that's an implementation of IDisposable.Dispose and doesn't call GC.SuppressFinalize + public class Case1 : IDisposable + { + private readonly IDisposable _item = null!; + + public void Dispose() => _item.Dispose(); // CA1816 + } + + // A method that's not an implementation of IDisposable.Dispose and calls GC.SuppressFinalize + public class Case2 + { + public void Test() => GC.SuppressFinalize(this); // CA1816 + } + + // A method that calls GC.SuppressFinalize and passes something other than this. + public sealed class Case3 : IDisposable + { + private readonly IDisposable _item = null!; + + public void Dispose() + { + _item.Dispose(); + GC.SuppressFinalize(_item); // CA1816 + } + } +} diff --git a/RuleTests/Roslyn/CA1821.RemoveEmptyFinalizers.cs b/RuleTests/Roslyn/CA1821.RemoveEmptyFinalizers.cs new file mode 100644 index 0000000..a16601e --- /dev/null +++ b/RuleTests/Roslyn/CA1821.RemoveEmptyFinalizers.cs @@ -0,0 +1,19 @@ +namespace RuleTests.Roslyn; + +public static class RemoveEmptyFinalizers +{ + public sealed class EmptyFinalizer + { + ~EmptyFinalizer() // CA1821 + { + } + } + + public sealed class NonEmptyFinalizer + { + ~NonEmptyFinalizer() + { + Console.WriteLine("Finalizer"); + } + } +} diff --git a/RuleTests/Roslyn/CA1822.MarkMembersAsStatic.cs b/RuleTests/Roslyn/CA1822.MarkMembersAsStatic.cs new file mode 100644 index 0000000..ba9afd9 --- /dev/null +++ b/RuleTests/Roslyn/CA1822.MarkMembersAsStatic.cs @@ -0,0 +1,11 @@ +namespace RuleTests.Roslyn; + +public static class MarkMembersAsStatic +{ + public class Test + { + public void Method() // CA1822 + { + } + } +} diff --git a/RuleTests/Roslyn/CA1825.AvoidZeroLengthArrayAllocations.cs b/RuleTests/Roslyn/CA1825.AvoidZeroLengthArrayAllocations.cs new file mode 100644 index 0000000..7a7ac03 --- /dev/null +++ b/RuleTests/Roslyn/CA1825.AvoidZeroLengthArrayAllocations.cs @@ -0,0 +1,6 @@ +namespace RuleTests.Roslyn; + +internal static class AvoidZeroLengthArrayAllocations +{ + public static int[] GetEmptyArray() => new int[0]; // CA1825 +} diff --git a/RuleTests/Roslyn/CA1826.UsePropertyInsteadOfLinqEnumerableMethod.cs b/RuleTests/Roslyn/CA1826.UsePropertyInsteadOfLinqEnumerableMethod.cs new file mode 100644 index 0000000..15933f5 --- /dev/null +++ b/RuleTests/Roslyn/CA1826.UsePropertyInsteadOfLinqEnumerableMethod.cs @@ -0,0 +1,11 @@ +namespace RuleTests.Roslyn; + +internal static class UsePropertyInsteadOfLinqEnumerableMethod +{ + public static void Test(IReadOnlyList list) + { + Console.Write(list.First()); // CA1826 + Console.Write(list.Last()); // CA1826 + Console.Write(list.Count()); // CA1826 + } +} diff --git a/RuleTests/Roslyn/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs b/RuleTests/Roslyn/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs new file mode 100644 index 0000000..4e5ebbd --- /dev/null +++ b/RuleTests/Roslyn/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs @@ -0,0 +1,8 @@ +namespace RuleTests.Roslyn; + +internal static class DoNotUseCountWhenAnyCanBeUsed +{ + public static bool IsEmpty1(IEnumerable items) => items.Count() == 0; + + public static bool IsEmpty2(IEnumerable items) => items.LongCount() == 0; +} diff --git a/ecoCode-csharp-test-project.csproj b/ecoCode-csharp-test-project.csproj index 343fcae..e545990 100644 --- a/ecoCode-csharp-test-project.csproj +++ b/ecoCode-csharp-test-project.csproj @@ -10,29 +10,12 @@ latest enable - all - True + True - - 1.0.0 - $(Version) - $(Version) - $(Version) - - - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/ecoCode-csharp-test-project.html b/ecoCode-csharp-test-project.html new file mode 100644 index 0000000..b0b4799 --- /dev/null +++ b/ecoCode-csharp-test-project.html @@ -0,0 +1,1558 @@ + + + + + +

EcoCode analyzer report

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DirectoryFileLocationSeverityCodeMessage
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 16, Column 35WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 16, Column 73WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 16, Column 86WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 16, Column 99WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 19, Column 30WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 19, Column 68WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 19, Column 81WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 19, Column 94WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 23, Column 30WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 23, Column 68WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 23, Column 81WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC69.DontCallFunctionsInLoopConditions.csRow 23, Column 94WarningEC69A loop invariant function is called in a loop condition
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC72.DontExecuteSqlCommandsInLoops.csRow 17, Column 17WarningEC72A SQL command is executed in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC72.DontExecuteSqlCommandsInLoops.csRow 18, Column 17WarningEC72A SQL command is executed in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC72.DontExecuteSqlCommandsInLoops.csRow 19, Column 17WarningEC72A SQL command is executed in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC72.DontExecuteSqlCommandsInLoops.csRow 20, Column 17WarningEC72A SQL command is executed in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC72.DontExecuteSqlCommandsInLoops.csRow 9, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 14, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 15, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 16, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 23, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 24, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 25, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 33, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 70, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 34, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 35, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 71, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 43, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 57, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 44, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 45, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 58, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 72, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 59, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 83, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 84, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 85, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 108, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 109, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 110, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 113, Column 33WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 114, Column 33WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 115, Column 33WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 122, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 123, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 124, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 127, Column 27WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 128, Column 27WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 129, Column 27WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 136, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 137, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 138, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 141, Column 30WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 142, Column 30WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 143, Column 30WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 149, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 150, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 151, Column 13WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 154, Column 41WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 155, Column 41WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC75.DontConcatenateStringsInLoops.csRow 156, Column 41WarningEC75A string is concatenated in a loop
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC81.SpecifyStructLayout.csRow 11, Column 35WarningEC81Use struct layout
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC81.SpecifyStructLayout.csRow 18, Column 35WarningEC81Use struct layout
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC81.SpecifyStructLayout.csRow 20, Column 35WarningEC81Use struct layout
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC82.VariableCanBeMadeConstant.csRow 7, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC82.VariableCanBeMadeConstant.csRow 27, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC82.VariableCanBeMadeConstant.csRow 34, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC82.VariableCanBeMadeConstant.csRow 37, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC82.VariableCanBeMadeConstant.csRow 40, Column 9InfoEC82A variable can be made constant
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 14, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 15, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 16, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 17, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 19, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 20, Column 27WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 23, Column 29WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 24, Column 29WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC83.ReplaceEnumToStringWithNameOf.csRow 25, Column 29WarningEC83Enum.ToString() can be replaced with nameof()
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC84.AvoidAsyncVoidMethods.csRow 7, Column 30WarningEC84Avoid async void methods
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC84.AvoidAsyncVoidMethods.csRow 19, Column 30WarningEC84Avoid async void methods
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC84.AvoidAsyncVoidMethods.csRow 7, Column 19InfoEC93Consider returning a Task directly instead of awaiting a single statement
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC84.AvoidAsyncVoidMethods.csRow 10, Column 19InfoEC93Consider returning a Task directly instead of awaiting a single statement
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 9, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 11, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 15, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 19, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 23, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC86.GCCollectShouldNotBeCalled.csRow 27, Column 9WarningEC86Avoid calling GC.Collect() method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 23, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 25, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 27, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 29, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 31, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 33, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 35, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 37, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC87.UseListIndexer.csRow 39, Column 27WarningEC87A list indexer should be used instead of a Linq method
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC88.DisposeResourceAsynchronusly.csRow 34, Column 9WarningEC88A resource can be disposed asynchronously
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC88.DisposeResourceAsynchronusly.csRow 37, Column 9WarningEC88A resource can be disposed asynchronously
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC91.UseWhereBeforeOrderBy.csRow 10, Column 14WarningEC91Call Where before OrderBy in a LINQ method chain
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC91.UseWhereBeforeOrderBy.csRow 19, Column 14WarningEC91Call Where before OrderBy in a LINQ method chain
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC91.UseWhereBeforeOrderBy.csRow 28, Column 21WarningEC91Call Where before OrderBy in a LINQ method chain
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC91.UseWhereBeforeOrderBy.csRow 37, Column 21WarningEC91Call Where before OrderBy in a LINQ method chain
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC93.ReturnTaskDirectly.csRow 27, Column 19InfoEC93Consider returning a Task directly instead of awaiting a single statement
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC93.ReturnTaskDirectly.csRow 31, Column 19InfoEC93Consider returning a Task directly instead of awaiting a single statement
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC93.ReturnTaskDirectly.csRow 38, Column 19InfoEC93Consider returning a Task directly instead of awaiting a single statement
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1827.DoNotUseCountWhenAnyCanBeUsed.csRow 5, Column 63InfoCA1827Count() is used where Any() could be used instead to improve performance
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1827.DoNotUseCountWhenAnyCanBeUsed.csRow 7, Column 63InfoCA1827LongCount() is used where Any() could be used instead to improve performance
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1001.TypesThatOwnDisposableFieldsShouldBeDisposable.csRow 5, Column 21HiddenCA1001Type 'TypesThatOwnDisposableFieldsShouldBeDisposable' owns disposable field(s) '_shouldBeDisposed' but is not disposable
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1825.AvoidZeroLengthArrayAllocations.csRow 5, Column 44InfoCA1825Avoid unnecessary zero-length array allocations. Use Array.Empty() instead.
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1805.DoNotInitializeUnnecessarily.csRow 5, Column 31HiddenCA1805Member 'MyInt' is explicitly initialized to its default value
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\RoslynCA1805.DoNotInitializeUnnecessarily.csRow 7, Column 35HiddenCA1805Member 'MyStr' is explicitly initialized to its default value
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 177, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 160, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 201, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 159, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 198, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 158, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 189, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 168, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 196, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 202, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 154, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 187, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 169, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 220, Column 30InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 194, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 179, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 161, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 229, Column 30InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 199, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 178, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 152, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 195, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 175, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 151, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 173, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 134, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 215, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 190, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 172, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 144, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 213, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 192, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 167, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 145, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 200, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 180, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 171, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 138, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 186, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 165, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 137, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 193, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 174, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 155, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 133, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 181, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 157, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 139, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 48, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 211, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 153, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 143, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 56, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 54, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 50, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 26, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 45, Column 25InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 37, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 32, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 30, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 27, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 20, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 14, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 9, Column 18InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 223, Column 24InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 212, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 188, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 166, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 55, Column 29InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 49, Column 29InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 44, Column 23InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 38, Column 27InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 36, Column 26InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 31, Column 28InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 21, Column 23InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 19, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 15, Column 23InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 13, Column 22InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
C:\Users\vlajoumard\source\ecoCode-csharp-test-project\RuleTests\EcoCodeEC85.MakeTypeSealed.csRow 10, Column 20InfoEC85Type may be sealed, as it has no subtypes in its assembly and no user-declared overridable member
+ + diff --git a/ecoCode-csharp-test-project.sln b/ecoCode-csharp-test-project.sln index 3596335..71d3e92 100644 --- a/ecoCode-csharp-test-project.sln +++ b/ecoCode-csharp-test-project.sln @@ -1,21 +1,9 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34714.143 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ecoCode-csharp-test-project", "ecoCode-csharp-test-project.csproj", "{6AAA1AD9-DC43-4F33-898A-663C42B06DCA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A894299-879E-459D-A0C0-2B25AD5EBD0D}" - ProjectSection(SolutionItems) = preProject - .gitattributes = .gitattributes - .gitignore = .gitignore - .github\workflows\build.yml = .github\workflows\build.yml - global.json = global.json - LICENCE.md = LICENCE.md - NuGet.Config = NuGet.Config - README.md = README.md - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,3 +22,14 @@ Global SolutionGuid = {E0DE71DC-90CB-4025-A57B-2F705B187C22} EndGlobalSection EndGlobal +d.0 = Debug|Any CPU + {6AAA1AD9-DC43-4F33-898A-663C42B06DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6AAA1AD9-DC43-4F33-898A-663C42B06DCA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E0DE71DC-90CB-4025-A57B-2F705B187C22} + EndGlobalSection +EndGlobal diff --git a/src/CA1825.AvoidZeroLengthArrayAllocations.cs b/src/CA1825.AvoidZeroLengthArrayAllocations.cs deleted file mode 100644 index 6f4478a..0000000 --- a/src/CA1825.AvoidZeroLengthArrayAllocations.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EcoCode.LiveWarnings; - -internal static class AvoidZeroLengthArrayAllocations -{ - public static void Run() - { - int[] anZeroLengthArray = new int[0]; // CA1825 - Console.WriteLine(anZeroLengthArray.Length); - } -} diff --git a/src/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs b/src/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs deleted file mode 100644 index 0a65ffb..0000000 --- a/src/CA1827.DoNotUseCountWhenAnyCanBeUsed.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EcoCode.LiveWarnings; - -internal static class DoNotUseCountWhenAnyCanBeUsed -{ - public static string M1(IEnumerable list) - => list.Count() != 0 ? "Not empty" : "Empty"; - - public static string M2(IEnumerable list) - => list.LongCount() > 0 ? "Not empty" : "Empty"; -}