Skip to content

Commit

Permalink
[FF-1429] - Update src\CodeAnalysis.ruleset to match the template repo
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Feb 15, 2023
1 parent 888a021 commit 2f2b1f9
Showing 1 changed file with 246 additions and 0 deletions.
246 changes: 246 additions & 0 deletions src/CodeAnalysis.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,260 @@
</Rules>
<Rules AnalyzerId="Meziantou.Analyzer" RuleNamespace="Meziantou.Analyzer">
<!-- See https://github.com/meziantou/Meziantou.Analyzer/tree/main/docs -->
<!-- MA0001 - StringComparison is missing information_source -->
<Rule Id="MA0001" Action="Error"/>
<!-- MA0002 - IEqualityComparer<string> or IComparer<string> is missing warning -->
<Rule Id="MA0002" Action="Error"/>
<!-- MA0003 -Add parameter name to improve readability -->
<Rule Id="MA0003" Action="Error"/>
<!-- MA0004 - Use ConfigureAwait(false) as the current SynchronizationContext is not needed -->
<Rule Id="MA0004" Action="None"/>
<!-- MA0005 - Use Array.Empty<T>() -->
<Rule Id="MA0005" Action="Error"/>
<!-- MA0006 - Use string.Equals instead of the comparison operator -->
<Rule Id="MA0006" Action="Info"/>
<!-- MA0007 - Add a comma after the last value -->
<Rule Id="MA0007" Action="None"/>
<!-- MA0008 - Add StructLayoutAttribute -->
<Rule Id="MA0008" Action="Error"/>
<!-- MA0009 - Add regex evaluation timeout -->
<Rule Id="MA0009" Action="Error"/>
<!-- MA0010 - Mark attributes with AttributeUsageAttribute -->
<Rule Id="MA0010" Action="Error"/>
<!-- MA0011 - IFormatProvider is missing -->
<Rule Id="MA0011" Action="Error"/>
<!-- MA0012 - Do not raise reserved exception type -->
<Rule Id="MA0012" Action="Error"/>
<!-- MA0013 - Types should not extend System.ApplicationException -->
<Rule Id="MA0013" Action="Error"/>
<!-- MA0014 - Do not raise System.ApplicationException -->
<Rule Id="MA0014" Action="Error"/>
<!-- MA0015 - Specify the parameter name in ArgumentException -->
<Rule Id="MA0015" Action="Error"/>
<!-- MA0016 - Prefer using collection abstraction instead of implementation -->
<Rule Id="MA0016" Action="Info"/>
<!-- MA0017 - Abstract types should not have public or internal constructors -->
<Rule Id="MA0017" Action="Error"/>
<!-- MA0018 - Do not declare static members on generic types -->
<Rule Id="MA0018" Action="Error"/>
<!-- MA0019 - Use EventArgs.Empty warning heavy_check_mark -->
<Rule Id="MA0019" Action="Error"/>
<!-- MA0020 - Use direct methods instead of LINQ methods -->
<Rule Id="MA0020" Action="Error"/>
<!-- MA0021 - Use StringComparer.GetHashCode instead of string.GetHashCode -->
<Rule Id="MA0021" Action="Error"/>
<!-- MA0022 - Return Task.FromResult instead of returning null -->
<Rule Id="MA0022" Action="Error"/>
<!-- MA0023 - Add RegexOptions.ExplicitCapture -->
<Rule Id="MA0023" Action="Error"/>
<!-- MA0024 - Use an explicit StringComparer when possible -->
<Rule Id="MA0024" Action="Error"/>
<!-- MA0025 - Implement the functionality instead of throwing NotImplementedException -->
<Rule Id="MA0025" Action="Error"/>
<!-- MA0026 - Don't leave TODO's scattered around -->
<Rule Id="MA0026" Action="Info"/>
<!-- MA0027 - Prefer rethrowing an exception implicitly -->
<Rule Id="MA0027" Action="Error"/>
<!-- MA0028 - Optimize StringBuilder usage -->
<Rule Id="MA0028" Action="Error"/>
<!-- MA0029 - Combine LINQ methods -->
<Rule Id="MA0029" Action="Error"/>
<!-- MA0030 - Remove useless OrderBy call -->
<Rule Id="MA0030" Action="Error"/>
<!-- MA0031 - Optimize Enumerable.Count() usage -->
<Rule Id="MA0031" Action="Error"/>
<!-- MA0032 - Use an overload with a CancellationToken argument -->
<Rule Id="MA0032" Action="Error"/>
<!-- MA0033 - Do not tag instance fields with ThreadStaticAttribute -->
<Rule Id="MA0033" Action="Error"/>
<!-- MA0035 - Do not use dangerous threading methods -->
<Rule Id="MA0035" Action="Error"/>
<!-- MA0036 - Make class static -->
<Rule Id="MA0036" Action="Error"/>
<!-- MA0037 - Remove empty statement -->
<Rule Id="MA0037" Action="Error"/>
<!-- MA0038 - Make method static -->
<Rule Id="MA0038" Action="Error"/>
<!-- MA0039 - Do not write your own certificate validation method -->
<Rule Id="MA0039" Action="Error"/>
<!-- MA0040 - Forward the CancellationToken parameter to methods that take one -->
<Rule Id="MA0040" Action="Error"/>
<!-- MA0041 - Make property static -->
<Rule Id="MA0041" Action="Error"/>
<!-- MA0042 - Do not use blocking calls in an async method -->
<Rule Id="MA0042" Action="Error"/>
<!-- MA0043 - Use nameof operator in ArgumentException -->
<Rule Id="MA0043" Action="Error"/>
<!-- MA0044 - Remove useless ToString call -->
<Rule Id="MA0044" Action="Error"/>
<!-- MA0045 - Do not use blocking calls in a sync method (need to make calling method async) -->
<Rule Id="MA0045" Action="Error"/>
<!-- MA0046 - Use EventHandler<T> to declare events -->
<Rule Id="MA0046" Action="Error"/>
<!-- MA0047 - Declare types in namespaces -->
<Rule Id="MA0047" Action="Error"/>
<!-- MA0048 - File name must match type name -->
<Rule Id="MA0048" Action="Error"/>
<!-- MA0049 - Type name should not match containing namespace -->
<Rule Id="MA0049" Action="Error"/>
<!-- MA0050 - Validate arguments correctly in iterator methods -->
<Rule Id="MA0050" Action="Error"/>
<!-- MA0051 - Method is too long -->
<Rule Id="MA0051" Action="Error"/>
<!-- MA0052 - Replace constant Enum.ToString with nameof -->
<Rule Id="MA0052" Action="Error"/>
<!-- MA0053 - Make class sealed -->
<Rule Id="MA0053" Action="Error"/>
<!-- MA0054 - Embed the caught exception as innerException -->
<Rule Id="MA0054" Action="Error"/>
<!-- MA0055 - Do not use finalizer -->
<Rule Id="MA0055" Action="Error"/>
<!-- MA0056 - Do not call overridable members in constructor -->
<Rule Id="MA0056" Action="Error"/>
<!-- MA0057 - Class name should end with 'Attribute' -->
<Rule Id="MA0057" Action="Error"/>
<!-- MA0058 - Class name should end with 'Exception' -->
<Rule Id="MA0058" Action="Error"/>
<!-- MA0059 - Class name should end with 'EventArgs' -->
<Rule Id="MA0059" Action="Error"/>
<!-- MA0060 - The value returned by Stream.Read/Stream.ReadAsync is not used -->
<Rule Id="MA0060" Action="Error"/>
<!-- MA0061 - Method overrides should not change default values -->
<Rule Id="MA0061" Action="Error"/>
<!-- MA0062 - Non-flags enums should not be marked with "FlagsAttribute" -->
<Rule Id="MA0062" Action="Error"/>
<!-- MA0063 - Use Where before OrderBy -->
<Rule Id="MA0063" Action="Error"/>
<!-- MA0064 - Avoid locking on publicly accessible instance -->
<Rule Id="MA0064" Action="Error"/>
<!-- MA0065 - Default ValueType.Equals or HashCode is used for struct equality -->
<Rule Id="MA0065" Action="Error"/>
<!-- MA0066 - Hash table unfriendly type is used in a hash table -->
<Rule Id="MA0066" Action="Error"/>
<!-- MA0067 - Use Guid.Empty -->
<Rule Id="MA0067" Action="Error"/>
<!-- MA0068 - Invalid parameter name for nullable attribute -->
<Rule Id="MA0068" Action="Error"/>
<!-- MA0069 - Non-constant static fields should not be visible -->
<Rule Id="MA0069" Action="Error"/>
<!-- MA0070 - Obsolete attributes should include explanations -->
<Rule Id="MA0070" Action="Error"/>
<!-- MA0071 - Avoid using redundant else -->
<Rule Id="MA0071" Action="Error"/>
<!-- MA0072 - Do not throw from a finally block -->
<Rule Id="MA0072" Action="Error"/>
<!-- MA0073 - Avoid comparison with bool constant -->
<Rule Id="MA0073" Action="Error"/>
<!-- MA0074 - Avoid implicit culture-sensitive methods -->
<Rule Id="MA0074" Action="Error"/>
<!-- MA0075 - Do not use implicit culture-sensitive ToString -->
<Rule Id="MA0075" Action="Error"/>
<!-- MA0076 - Do not use implicit culture-sensitive ToString in interpolated strings -->
<Rule Id="MA0076" Action="None"/>
<!-- MA0077 - A class that provides Equals(T) should implement IEquatable<T> -->
<Rule Id="MA0077" Action="Error"/>
<!-- MA0078 - Use 'Cast' instead of 'Select' to cast -->
<Rule Id="MA0078" Action="Error"/>
<!-- MA0079 - Forward the CancellationToken using .WithCancellation() -->
<Rule Id="MA0079" Action="Error"/>
<!-- MA0080 - Use a cancellation token using .WithCancellation() -->
<Rule Id="MA0080" Action="Error"/>
<!-- MA0081 - Method overrides should not omit params keyword -->
<Rule Id="MA0081" Action="Error"/>
<!-- MA0082 - NaN should not be used in comparisons -->
<Rule Id="MA0082" Action="Error"/>
<!-- MA0083 - ConstructorArgument parameters should exist in constructors -->
<Rule Id="MA0083" Action="Error"/>
<!-- MA0084 - Local variables should not hide other symbols -->
<Rule Id="MA0084" Action="Error"/>
<!-- MA0085 - Anonymous delegates should not be used to unsubscribe from Events -->
<Rule Id="MA0085" Action="Error"/>
<!-- MA0086 - Do not throw from a finalizer -->
<Rule Id="MA0086" Action="Error"/>
<!-- MA0087 - Parameters with [DefaultParameterValue] attributes should also be marked [Optional] -->
<Rule Id="MA0087" Action="Error"/>
<!-- MA0088 - Use [DefaultParameterValue] instead of [DefaultValue] -->
<Rule Id="MA0088" Action="Error"/>
<!-- MA0089 - Optimize string method usage -->
<Rule Id="MA0089" Action="Error"/>
<!-- MA0090 - Remove empty else/finally block information_source -->
<Rule Id="MA0090" Action="Error"/>
<!-- MA0091 - Sender should be 'this' for instance events -->
<Rule Id="MA0091" Action="Error"/>
<!-- MA0092 - Sender should be 'null' for static events -->
<Rule Id="MA0092" Action="Error"/>
<!-- MA0093 - EventArgs should not be null -->
<Rule Id="MA0093" Action="Error"/>
<!-- MA0094 - A class that provides CompareTo(T) should implement IComparable<T> -->
<Rule Id="MA0094" Action="Error"/>
<!-- MA0095 - A class that implements IEquatable<T> should override Equals(object) -->
<Rule Id="MA0095" Action="Error"/>
<!-- MA0096 - A class that implements IComparable<T> should also implement IEquatable<T> -->
<Rule Id="MA0096" Action="Error"/>
<!-- MA0097 - A class that implements IComparable<T> or IComparable should override comparison operators -->
<Rule Id="MA0097" Action="Error"/>
<!-- MA0098 - Use indexer instead of LINQ methods information_source -->
<Rule Id="MA0098" Action="Error"/>
<!-- MA0099 - Use Explicit enum value instead of 0 -->
<Rule Id="MA0099" Action="Error"/>
<!-- MA0100 - Await task before disposing of resources -->
<Rule Id="MA0100" Action="Error"/>
<!-- MA0101 - String contains an implicit end of line character -->
<Rule Id="MA0101" Action="None"/>
<!-- MA0102 - Make member readonly -->
<Rule Id="MA0102" Action="Error"/>
<!-- MA0103 - Use SequenceEqual instead of equality operator -->
<Rule Id="MA0103" Action="Error"/>
<!-- MA0104 - Do not create a type with a name from the BCL -->
<Rule Id="MA0104" Action="Error"/>
<!-- MA0105 - Use the lambda parameters instead of using a closure -->
<Rule Id="MA0105" Action="Error"/>
<!-- MA0106 - Avoid closure by using an overload with the 'factoryArgument' parameter -->
<Rule Id="MA0106" Action="Error"/>
<!-- MA0107 - Do not use culture-sensitive object.ToString -->
<Rule Id="MA0107" Action="Error"/>
<!-- MA0108 - Remove redundant argument value -->
<Rule Id="MA0108" Action="Error"/>
<!-- MA0109 - Consider adding an overload with a Span<T> or Memory<T> -->
<Rule Id="MA0109" Action="Error"/>
<!-- MA0110 - Use the Regex source generator -->
<Rule Id="MA0110" Action="Error"/>
<!-- MA0111 - Use string.Create instead of FormattableString -->
<Rule Id="MA0111" Action="Error"/>
<!-- MA0112 - Use 'Count > 0' instead of 'Any()' -->
<Rule Id="MA0112" Action="Error"/>
<!-- MA0113 - Use DateTime.UnixEpoch -->
<Rule Id="MA0113" Action="Error"/>
<!-- MA0114 - Use DateTimeOffset.UnixEpoch -->
<Rule Id="MA0114" Action="Error"/>
<!-- MA0115 - Unknown component parameter -->
<Rule Id="MA0115" Action="Error"/>
<!-- MA0116 - Parameters with [SupplyParameterFromQuery] attributes should also be marked as [Parameter] -->
<Rule Id="MA0116" Action="Error"/>
<!-- MA0117 - Parameters with [EditorRequired] attributes should also be marked as [Parameter] -->
<Rule Id="MA0117" Action="Error"/>
<!-- MA0118 - [JSInvokable] methods must be public -->
<Rule Id="MA0118" Action="Error"/>
<!-- MA0119 - JSRuntime must not be used in OnInitialized or OnInitializedAsync -->
<Rule Id="MA0119" Action="Error"/>
<!-- MA0120 - Use InvokeVoidAsync when the returned value is not used -->
<Rule Id="MA0120" Action="Error"/>
<!-- MA0121 - Do not overwrite parameter value -->
<Rule Id="MA0121" Action="Error"/>
<!-- MA0122 - Parameters with [SupplyParameterFromQuery] attributes are only valid in routable components (@page) -->
<Rule Id="MA0122" Action="Error"/>
<!-- MA0123 - Sequence number must be a constant -->
<Rule Id="MA0123" Action="Error"/>
<!-- MA0124 - Log Parameter type is not valid -->
<Rule Id="MA0124" Action="Error"/>
<!-- MA0125 - The list of log parameter types contains an invalid type -->
<Rule Id="MA0125" Action="Error"/>
<!-- MA0126 - The list of log parameter types contains a duplicate -->
<Rule Id="MA0126" Action="Error"/>
<!-- MA0127 - Use String.Equals instead of is pattern -->
<Rule Id="MA0127" Action="Error"/>
<!-- MA0128 - Use 'is' operator instead of SequenceEqual -->
<Rule Id="MA0128" Action="Error"/>
</Rules>
<Rules AnalyzerId="Philips.CodeAnalysis.DuplicateCodeAnalyzer" RuleNamespace="Philips.CodeAnalysis.DuplicateCodeAnalyzer">
<!-- See https://github.com/philips-software/roslyn-analyzers/blob/master/Philips.CodeAnalysis.DuplicateCodeAnalyzer/Philips.CodeAnalysis.DuplicateCodeAnalyzer.md -->
Expand Down

0 comments on commit 2f2b1f9

Please sign in to comment.