diff --git a/src/libraries/Common/src/System/Drawing/KnownColor.cs b/src/libraries/Common/src/System/Drawing/KnownColor.cs index f4297863106ad5..8f4694c5421ed3 100644 --- a/src/libraries/Common/src/System/Drawing/KnownColor.cs +++ b/src/libraries/Common/src/System/Drawing/KnownColor.cs @@ -7,7 +7,6 @@ namespace System.Drawing { - [SuppressMessage("Microsoft.Design", "CA1008:EnumsShouldHaveZeroValue")] [TypeForwardedFrom("System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] #if NETCOREAPP2_0 internal diff --git a/src/libraries/Common/tests/Resources/Strings.Designer.cs b/src/libraries/Common/tests/Resources/Strings.Designer.cs index a4f700f12eb64f..73c0f1972ae0d2 100644 --- a/src/libraries/Common/tests/Resources/Strings.Designer.cs +++ b/src/libraries/Common/tests/Resources/Strings.Designer.cs @@ -29,7 +29,6 @@ internal class Strings { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs index f3b1ef19801444..eaef0009a633e3 100644 --- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs +++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft/Win32/RegistryKey.cs @@ -126,7 +126,6 @@ public void Dispose() /// Creates a new subkey, or opens an existing one. /// Name or path to subkey to create or open. /// The subkey, or null if the operation failed. - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread safety")] public RegistryKey CreateSubKey(string subkey) { return CreateSubKey(subkey, _checkMode); diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs index 0fb80344d7f17c..06e9bff4dae87f 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft/Win32/SystemEvents.cs @@ -70,7 +70,6 @@ private SystemEvents() // stole from SystemInformation... if we get SystemInformation moved // to somewhere that we can use it... rip this! - [SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")] private static volatile IntPtr s_processWinStation = IntPtr.Zero; private static volatile bool s_isUserInteractive = false; private static unsafe bool UserInteractive @@ -715,8 +714,6 @@ private unsafe void Initialize() /// This empties this control's callback queue, propagating any exceptions /// back as needed. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void InvokeMarshaledCallbacks() { Debug.Assert(s_threadCallbackList != null, "Invoking marshaled callbacks before there are any"); @@ -998,8 +995,6 @@ private static void RaiseEvent(object key, params object[] args) RaiseEvent(true, key, args); } - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static void RaiseEvent(bool checkFinalization, object key, params object[] args) { Debug.Assert(args != null && args.Length == 2); @@ -1129,8 +1124,6 @@ private static void Shutdown(object? sender, EventArgs e) /// /// A standard Win32 window proc for our broadcast window. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) { switch (msg) @@ -1255,8 +1248,6 @@ private IntPtr WindowProc(IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) /// is made visible with a size of 0, 0, so that it will trap /// global broadcast messages. /// - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void WindowThreadProc() { try diff --git a/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs b/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs deleted file mode 100644 index 7f4af832de847e..00000000000000 --- a/src/libraries/System.Collections.Immutable/src/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// 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. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Collections.Generic")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1016:MarkAssembliesWithAssemblyVersion", Justification = "The official build system adds this attribute.")] diff --git a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj index c8521b06c4acf3..52d3aaa47ae38e 100644 --- a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj @@ -10,7 +10,6 @@ - diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs index 452ac0e71ff918..9a2fcaf84dcca1 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/IHashKeyCollection.cs @@ -8,7 +8,6 @@ namespace System.Collections.Generic /// Defined on a generic collection that hashes its contents using an . /// /// The type of element hashed in the collection. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] internal interface IHashKeyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs index b7896403e79613..aff634c2e52c1b 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Generic/ISortKeyCollection.cs @@ -10,7 +10,6 @@ namespace System.Collections.Generic /// Defined on a generic collection that sorts its contents using an . /// /// The type of element sorted in the collection. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] internal interface ISortKeyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs index 2db135949b49ed..ef33b1c2663199 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableDictionary.cs @@ -13,8 +13,6 @@ namespace System.Collections.Immutable /// /// The type of the key. /// The type of the value. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableDictionary : IReadOnlyDictionary { /// @@ -42,7 +40,6 @@ public interface IImmutableDictionary : IReadOnlyDictionaryThe pairs. /// The new dictionary containing the additional key-value pairs. /// Thrown when one of the given keys already exists in the dictionary but has a different value. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] IImmutableDictionary AddRange(IEnumerable> pairs); @@ -65,7 +62,6 @@ public interface IImmutableDictionary : IReadOnlyDictionaryThe key=value pairs to set on the dictionary. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] IImmutableDictionary SetItems(IEnumerable> items); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs index b6e4297e184069..05545062d45708 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableList.cs @@ -16,7 +16,6 @@ namespace System.Collections.Immutable /// Mutations on this list generate new lists. Incremental changes to a list share as much memory as possible with the prior versions of a list, /// while allowing garbage collection to clean up any unique list data that is no longer being referenced. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableList : IReadOnlyList { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs index 588980f2b99894..9209b1a599d8b8 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableQueue.cs @@ -12,8 +12,6 @@ namespace System.Collections.Immutable /// An immutable queue. /// /// The type of elements in the queue. - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public interface IImmutableQueue : IEnumerable { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs index 9dce4cdb3177f0..45acf280f7a7a6 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableSet.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// Mutations on this set generate new sets. Incremental changes to a set share as much memory as possible with the prior versions of a set, /// while allowing garbage collection to clean up any unique set data that is no longer being referenced. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public interface IImmutableSet : IReadOnlyCollection { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs index 0a52496e1fd502..73a892c909edaf 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/IImmutableStack.cs @@ -12,8 +12,6 @@ namespace System.Collections.Immutable /// An immutable stack. /// /// The type of elements stored in the stack. - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public interface IImmutableStack : IEnumerable { /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs index c6d8239ab2f1b4..68b9bfc2670b27 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableDictionary { /// @@ -66,7 +65,6 @@ public static ImmutableDictionary Create(IEqualityCo /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.AddRange(items); @@ -81,7 +79,6 @@ public static ImmutableDictionary CreateRange(IEnume /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEqualityComparer? keyComparer, IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.WithComparers(keyComparer).AddRange(items); @@ -97,7 +94,6 @@ public static ImmutableDictionary CreateRange(IEqual /// The items to prepopulate. /// The new immutable collection. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary CreateRange(IEqualityComparer? keyComparer, IEqualityComparer? valueComparer, IEnumerable> items) where TKey : notnull { return ImmutableDictionary.Empty.WithComparers(keyComparer, valueComparer).AddRange(items); @@ -250,7 +246,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe value comparer to use for the immutable map. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source, IEqualityComparer? keyComparer, IEqualityComparer? valueComparer) where TKey : notnull { Requires.NotNull(source, nameof(source)); @@ -273,7 +268,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe key comparer to use when building the immutable map. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source, IEqualityComparer? keyComparer) where TKey : notnull { return ToImmutableDictionary(source, keyComparer, null); @@ -287,7 +281,6 @@ public static ImmutableDictionary ToImmutableDictionaryThe sequence of key=value pairs. /// An immutable map. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ImmutableDictionary ToImmutableDictionary(this IEnumerable> source) where TKey : notnull { return ToImmutableDictionary(source, null, null); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs index 11717ea790ac64..5b94faa3d30b15 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableDictionary { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableDictionary /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableDictionaryBuilderDebuggerProxy<,>))] public sealed class Builder : IDictionary, IReadOnlyDictionary, IDictionary @@ -435,7 +432,6 @@ public TValue this[TKey key] /// Adds a sequence of values to this collection. /// /// The items. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void AddRange(IEnumerable> items) { var result = ImmutableDictionary.AddRange(items, this.Origin); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs index d921380648fa99..1d5241c15c31db 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.cs @@ -22,7 +22,6 @@ public sealed partial class ImmutableDictionary : IImmutableDictio /// /// An empty immutable dictionary with default equality comparers. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableDictionary Empty = new ImmutableDictionary(); /// @@ -313,7 +312,6 @@ public ImmutableDictionary Add(TKey key, TValue value) /// See the interface. /// [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImmutableDictionary AddRange(IEnumerable> pairs) { Requires.NotNull(pairs, nameof(pairs)); @@ -339,7 +337,6 @@ public ImmutableDictionary SetItem(TKey key, TValue value) /// The key=value pairs to set on the map. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. [Pure] - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImmutableDictionary SetItems(IEnumerable> items) { Requires.NotNull(items, nameof(items)); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs index 589a3e0796ce1f..d212581554bd8c 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.Builder.cs @@ -11,7 +11,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableHashSet { /// @@ -28,8 +27,6 @@ public sealed partial class ImmutableHashSet /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] public sealed class Builder : IReadOnlyCollection, ISet { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs index 8fc536af27da4a..8482c10690f7b0 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableHashSet_1.cs @@ -21,7 +21,6 @@ public sealed partial class ImmutableHashSet : IImmutableSet, IHashKeyColl /// /// An empty immutable hash set with the default comparer for . /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableHashSet Empty = new ImmutableHashSet(SortedInt32KeyNode.EmptyNode, EqualityComparer.Default, 0); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs index bc64eb241dd55d..104ffe2e92f574 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner Builder class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableList { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableList /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableListBuilderDebuggerProxy<>))] public sealed class Builder : IList, IList, IOrderedCollection, IImmutableListQueries, IReadOnlyList @@ -130,7 +127,6 @@ private set /// /// The index of the desired element. /// The value at the specified index. - [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "index+1", Justification = "There is no chance of this overflowing")] public T this[int index] { get diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs index aa9053678af362..d7a0f7fcb6acd1 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.cs @@ -21,7 +21,6 @@ public sealed partial class ImmutableList : IImmutableList, IList, ILis /// /// An empty immutable list. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableList Empty = new ImmutableList(); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs index 7fe64df847c093..107fa536c11751 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableQueue { /// @@ -105,7 +104,6 @@ public static ImmutableQueue Create(params T[] items) /// Receives the value from the head of the queue. /// The new queue with the head element removed. /// Thrown when the stack is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#")] [Pure] public static IImmutableQueue Dequeue(this IImmutableQueue queue, out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs index 2a894af2182ca0..c0263bcec802bc 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableQueue_1.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// The type of elements stored in the queue. [DebuggerDisplay("IsEmpty = {IsEmpty}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableQueue : IImmutableQueue { /// @@ -222,7 +220,6 @@ public ImmutableQueue Dequeue() /// Receives the value from the head of the queue. /// The new queue with the head element removed. /// Thrown when the queue is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")] [Pure] public ImmutableQueue Dequeue(out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs index e5881dfeaf3a19..658c8299fdaf38 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableSortedDictionary { /// @@ -61,7 +60,6 @@ public static ImmutableSortedDictionary Create(IComp /// The type of values stored by the dictionary. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IEnumerable> items) where TKey : notnull { @@ -76,7 +74,6 @@ public static ImmutableSortedDictionary CreateRange( /// The key comparer. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IComparer? keyComparer, IEnumerable> items) where TKey : notnull { @@ -92,7 +89,6 @@ public static ImmutableSortedDictionary CreateRange( /// The value comparer. /// The items to prepopulate. /// The new immutable collection. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary CreateRange(IComparer? keyComparer, IEqualityComparer? valueComparer, IEnumerable> items) where TKey : notnull { @@ -216,7 +212,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The key comparer to use when building the immutable map. /// The value comparer to use for the immutable map. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source, IComparer? keyComparer, IEqualityComparer? valueComparer) where TKey : notnull { @@ -239,7 +234,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The sequence of key=value pairs. /// The key comparer to use when building the immutable map. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source, IComparer? keyComparer) where TKey : notnull { @@ -253,7 +247,6 @@ public static ImmutableSortedDictionary ToImmutableSortedDictionar /// The type of value in the map. /// The sequence of key=value pairs. /// An immutable map. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public static ImmutableSortedDictionary ToImmutableSortedDictionary(this IEnumerable> source) where TKey : notnull { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs index eee40acc4cd9b5..03b403bb4d6d87 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableSortedDictionary where TKey : notnull { /// @@ -27,8 +26,6 @@ public sealed partial class ImmutableSortedDictionary where TKey : /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableSortedDictionaryBuilderDebuggerProxy<,>))] public sealed class Builder : IDictionary, IReadOnlyDictionary, IDictionary @@ -580,7 +577,6 @@ public bool ContainsValue(TValue value) /// Removes any entries from the dictionaries with keys that match those found in the specified sequence. /// /// The keys for entries to remove from the dictionary. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void AddRange(IEnumerable> items) { Requires.NotNull(items, nameof(items)); diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs index af7c4821922d16..50a582cae96579 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs @@ -23,7 +23,6 @@ public sealed partial class ImmutableSortedDictionary : IImmutable /// /// An empty sorted dictionary with default sort and equality comparers. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableSortedDictionary Empty = new ImmutableSortedDictionary(); /// @@ -282,7 +281,6 @@ public ImmutableSortedDictionary SetItem(TKey key, TValue value) /// /// The key=value pairs to set on the map. Any keys that conflict with existing keys will overwrite the previous values. /// An immutable dictionary. - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public ImmutableSortedDictionary SetItems(IEnumerable> items) { @@ -294,7 +292,6 @@ public ImmutableSortedDictionary SetItems(IEnumerable /// See the interface. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] [Pure] public ImmutableSortedDictionary AddRange(IEnumerable> items) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs index a31de704c31140..4cb1476d262bc2 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.cs @@ -12,7 +12,6 @@ namespace System.Collections.Immutable /// /// Contains the inner class. /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableSortedSet { /// @@ -29,8 +28,6 @@ public sealed partial class ImmutableSortedSet /// Instance members of this class are not thread-safe. /// /// - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Ignored")] [DebuggerDisplay("Count = {Count}")] [DebuggerTypeProxy(typeof(ImmutableSortedSetBuilderDebuggerProxy<>))] public sealed class Builder : ISortKeyCollection, IReadOnlyCollection, ISet, ICollection diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs index bc1482baa8e4b3..94fca217387672 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.cs @@ -33,7 +33,6 @@ public sealed partial class ImmutableSortedSet : IImmutableSet, ISortKeyCo /// /// An empty sorted set with the default sort comparer. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly ImmutableSortedSet Empty = new ImmutableSortedSet(); /// diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs index 9361c6909f2f06..91cc379b79d460 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack.cs @@ -11,7 +11,6 @@ namespace System.Collections.Immutable /// /// A set of initialization methods for instances of . /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public static class ImmutableStack { /// @@ -87,7 +86,6 @@ public static ImmutableStack Create(params T[] items) /// A stack; never null /// /// Thrown when the stack is empty. - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#")] [Pure] public static IImmutableStack Pop(this IImmutableStack stack, out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs index 55decdba78ab0f..a6d0c1d8e22a1e 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableStack_1.cs @@ -16,8 +16,6 @@ namespace System.Collections.Immutable /// The type of element stored by the stack. [DebuggerDisplay("IsEmpty = {IsEmpty}; Top = {_head}")] [DebuggerTypeProxy(typeof(ImmutableEnumerableDebuggerProxy<>))] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "Ignored")] - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Ignored")] public sealed partial class ImmutableStack : IImmutableStack { /// @@ -184,7 +182,6 @@ public ImmutableStack Pop() /// /// A stack; never null /// - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")] [Pure] public ImmutableStack Pop(out T value) { diff --git a/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs b/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs index 06e65df734c581..7305c45cbcc32f 100644 --- a/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs +++ b/src/libraries/System.Collections.Immutable/src/Validation/Requires.cs @@ -121,7 +121,6 @@ public static void Argument(bool condition, string? parameterName, string? messa /// /// Throws an if a condition does not evaluate to true. /// - [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] [DebuggerStepThrough] public static void Argument(bool condition) { diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs index 6b3864398c3572..8b2486b03204a6 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/HashSet.cs @@ -47,7 +47,6 @@ namespace System.Collections.Generic /// [DebuggerTypeProxy(typeof(ICollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "By design")] [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class HashSet : ICollection, ISet, IReadOnlyCollection, ISerializable, IDeserializationCallback diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs index d4c290148a6bb4..1a3ea108836c9d 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/LinkedList.cs @@ -526,7 +526,6 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator, ISerializable, IDeserializationCallback { private readonly LinkedList _list; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs b/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs index f8e8b26892e1e9..410360ab0cadb3 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/Queue.cs @@ -390,7 +390,6 @@ public void TrimExcess() // Implements an enumerator for a Queue. The enumerator uses the // internal version number of the list to ensure that no modifications are // made to the list while an enumeration is in progress. - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs index 5f59ab47609b1e..a62acb52c1b8cd 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedDictionary.cs @@ -441,7 +441,6 @@ IEnumerator IEnumerable.GetEnumerator() return new Enumerator(this, Enumerator.KeyValuePair); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator>, IDictionaryEnumerator { private TreeSet>.Enumerator _treeEnum; @@ -689,7 +688,6 @@ object ICollection.SyncRoot get { return ((ICollection)_dictionary).SyncRoot; } } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator { private SortedDictionary.Enumerator _dictEnum; @@ -873,7 +871,6 @@ object ICollection.SyncRoot get { return ((ICollection)_dictionary).SyncRoot; } } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator { private SortedDictionary.Enumerator _dictEnum; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs index d82c4052aa86ec..33ba6d3f15ca74 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/SortedSet.cs @@ -41,7 +41,6 @@ internal enum TreeRotation : byte RightLeft } - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "by design name choice")] [DebuggerTypeProxy(typeof(ICollectionDebugView<>))] [DebuggerDisplay("Count = {Count}")] [Serializable] @@ -1899,7 +1898,6 @@ private bool HasChildren(Node child1, Node child2) #endif } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, IEnumerator, ISerializable, IDeserializationCallback { private readonly SortedSet _tree; diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs b/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs index 2b4fa1efd36a45..345ed27023786e 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/Stack.cs @@ -311,7 +311,6 @@ private void ThrowForEmptyStack() throw new InvalidOperationException(SR.InvalidOperation_EmptyStack); } - [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes", Justification = "not an expected scenario")] public struct Enumerator : IEnumerator, System.Collections.IEnumerator { private readonly Stack _stack; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs index c218156213f755..91146252cf3119 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModelServices.cs @@ -17,7 +17,6 @@ namespace System.ComponentModel.Composition { public static class AttributedModelServices { - [SuppressMessage("Microsoft.Design", "CA1004")] public static TMetadataView GetMetadataView(IDictionary metadata) { Requires.NotNull(metadata, nameof(metadata)); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs index 7328e03ddbb0e3..f5b427252c7374 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CatalogReflectionContextAttribute.cs @@ -11,7 +11,6 @@ namespace System.ComponentModel.Composition /// /// Enables the AssemblyCatalog to discover user provided ReflectionContexts. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = true)] public class CatalogReflectionContextAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs index ef5cc34ccf93c1..63878089e90bf4 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a type, property, field, or method provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] public class ExportAttribute : Attribute diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs index f016f950cc4053..6552b48bdf5540 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.cs @@ -83,7 +83,6 @@ internal static Func> CreateSemiStronglyTypedLazyFa return (Func>)Delegate.CreateDelegate(typeof(Func>), genericMethod); } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateStronglyTypedLazyOfTM(Export export) { if (export is IDisposable disposable) @@ -103,7 +102,6 @@ internal static Lazy CreateStronglyTypedLazyOfTM(Export export) } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateStronglyTypedLazyOfT(Export export) { if (export is IDisposable disposable) @@ -119,7 +117,6 @@ internal static Lazy CreateStronglyTypedLazyOfT(Export export) } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Lazy CreateSemiStronglyTypedLazy(Export export) { if (export is IDisposable disposable) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs index 8f583bab2cbe98..8a31d548cc661a 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ApplicationCatalog.cs @@ -200,7 +200,6 @@ public override string ToString() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -212,7 +211,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs index 4a9fe60e5f0801..29b300aaa22327 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalog.cs @@ -479,7 +479,6 @@ public Assembly Assembly /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -491,7 +490,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs index b7e606ca65d78e..fedf72f5cb7e79 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicComposition.cs @@ -76,7 +76,6 @@ public bool TryGetValue(object key, [MaybeNullWhen(false)] out T value) return TryGetValue(key, false, out value); } - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")] public bool TryGetValue(object key, bool localAtomicCompositionOnly, [MaybeNullWhen(false)] out T value) { ThrowIfDisposed(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs index 3fe89135b7cdac..c2a2a5685d5a83 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.CatalogExport.cs @@ -60,7 +60,6 @@ protected virtual CatalogPart GetPart() return _catalogExportProvider.GetExportedValue(GetPart(), _definition, IsSharedPart); } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public static CatalogExport CreateExport(CatalogExportProvider catalogExportProvider, ComposablePartDefinition partDefinition, ExportDefinition definition, CreationPolicy importCreationPolicy) { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs index 9c06b88365406a..825bdbf61744e3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.cs @@ -149,7 +149,6 @@ public ComposablePartCatalog Catalog /// This property must be set before accessing any methods on the /// . /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "EnsureCanSet ensures that the property is set only once, Dispose is not required")] [DisallowNull] public ExportProvider? SourceProvider { @@ -397,7 +396,6 @@ private static ExportDefinition[] GetExportsFromPartDefinitions(IEnumerable. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Justification = "EnsureCanSet ensures that the property is set only once, Dispose is not required")] [DisallowNull] public ExportProvider? SourceProvider { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs index 17ac42c5569206..e34ae080f0e96c 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs @@ -413,7 +413,6 @@ public void Compose(CompositionBatch batch) /// /// is . /// - [SuppressMessage("Microsoft.Performance", "CA1822")] public void ReleaseExport(Export export) { Requires.NotNull(export, nameof(export)); @@ -443,7 +442,6 @@ public void ReleaseExport(Export export) /// /// is . /// - [SuppressMessage("Microsoft.Performance", "CA1822")] public void ReleaseExport(Lazy export) { Requires.NotNull(export, nameof(export)); @@ -486,7 +484,6 @@ public void ReleaseExports(IEnumerable exports) /// /// contains an element that is . /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void ReleaseExports(IEnumerable> exports) { Requires.NotNullOrNullElements(exports, nameof(exports)); @@ -508,7 +505,6 @@ public void ReleaseExports(IEnumerable> exports) /// /// contains an element that is . /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public void ReleaseExports(IEnumerable> exports) { Requires.NotNullOrNullElements(exports, nameof(exports)); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs index a6937445c3a015..16fffd4582b158 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs @@ -782,7 +782,6 @@ private void ThrowIfDisposed() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -794,7 +793,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs index c986f2fdf89ba6..843e45694e3431 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ExportProvider.GetExportOverrides.cs @@ -259,7 +259,6 @@ public abstract partial class ExportProvider /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(Type type, Type? metadataViewType, string? contractName) { IEnumerable exports = GetExportsCore(type, metadataViewType, contractName, ImportCardinality.ZeroOrMore); @@ -306,7 +305,6 @@ public IEnumerable> GetExports(Type type, Type? metadataVie /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports() { return GetExports((string?)null); @@ -348,7 +346,6 @@ public IEnumerable> GetExports() /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(string? contractName) { return GetExportsCore(contractName); @@ -387,7 +384,6 @@ public IEnumerable> GetExports(string? contractName) /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports() { return GetExports((string?)null); @@ -430,7 +426,6 @@ public IEnumerable> GetExports() /// /// The has been disposed of. /// - [SuppressMessage("Microsoft.Design", "CA1006")] public IEnumerable> GetExports(string? contractName) { return GetExportsCore(contractName); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs index a2723843544a00..68c2f61b689edd 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/TypeCatalog.cs @@ -230,7 +230,6 @@ public override IEnumerator GetEnumerator() /// /// A containing a human-readable display name of the . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] string ICompositionElement.DisplayName { get { return GetDisplayName(); } @@ -242,7 +241,6 @@ string ICompositionElement.DisplayName /// /// This property always returns . /// - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")] ICompositionElement? ICompositionElement.Origin { get { return null; } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs index 73d0d6573c8819..ca047bc2739e6d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a property, field, or parameter imports a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportAttribute : Attribute, IAttributedImport diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs index 16530479dd69a0..64ac5a4e0351f1 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportManyAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a property, field, or parameter imports a particular set of exports. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportManyAttribute : Attribute, IAttributedImport diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs index aae782bb62fd2b..a7443e23db7487 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportingConstructorAttribute.cs @@ -14,7 +14,6 @@ namespace System.ComponentModel.Composition /// construct an attributed part. Use this attribute to indicate that a specific constructor /// should be used. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)] public class ImportingConstructorAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs index f28cb9909708fe..df05c49f4b8d20 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/InheritedExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition /// /// Specifies that a type or interface that provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true, Inherited = true)] public class InheritedExportAttribute : ExportAttribute { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs index ac61aa5dc1b1e3..a1d4b4bb49db31 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewProvider.cs @@ -13,7 +13,6 @@ namespace System.ComponentModel.Composition { internal static class MetadataViewProvider { - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] public static TMetadataView GetMetadataView(IDictionary metadata) { if (metadata == null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs index 2e3a3c7c129595..7060c1b6e2ec04 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalog.cs @@ -95,7 +95,6 @@ public virtual IQueryable Parts /// , return an empty . /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual IEnumerable> GetExports(ImportDefinition definition) { ThrowIfDisposed(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs index 4d35ba1fd2e7fc..4612c45e6a6156 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ContractBasedImportDefinition.cs @@ -99,7 +99,6 @@ protected ContractBasedImportDefinition() /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable>? requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, CreationPolicy requiredCreationPolicy) : this(contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, isPrerequisite, requiredCreationPolicy, MetadataServices.EmptyMetadata) @@ -161,7 +160,6 @@ public ContractBasedImportDefinition(string contractName, string? requiredTypeId /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ContractBasedImportDefinition(string contractName, string? requiredTypeIdentity, IEnumerable>? requiredMetadata, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, CreationPolicy requiredCreationPolicy, IDictionary metadata) : base(contractName, cardinality, isRecomposable, isPrerequisite, metadata) @@ -207,7 +205,6 @@ public virtual string? RequiredTypeIdentity /// return an empty instead. /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual IEnumerable> RequiredMetadata { get diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs index d8a7e312782d8f..573e54384e34b5 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/Export.cs @@ -233,7 +233,6 @@ public object? Value /// . /// /// - [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] protected virtual object? GetExportedValueCore() { if (_exportedValueGetter != null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs index abc220143790a9..e9a1ca30bfdd2d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ExportedDelegate.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel.Composition.Primitives { - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] public class ExportedDelegate { private readonly object? _instance; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs index 83ddadfe4862f1..27210edd4cc1c3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ImportDefinition.cs @@ -79,7 +79,6 @@ protected ImportDefinition() /// is not one of the /// values. /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImportDefinition(Expression> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite) : this(contractName, cardinality, isRecomposable, isPrerequisite, MetadataServices.EmptyMetadata) { @@ -88,7 +87,6 @@ public ImportDefinition(Expression> constraint, str _constraint = constraint; } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ImportDefinition(Expression> constraint, string? contractName, ImportCardinality cardinality, bool isRecomposable, bool isPrerequisite, IDictionary? metadata) : this(contractName, cardinality, isRecomposable, isPrerequisite, metadata) { @@ -200,7 +198,6 @@ public virtual ImportCardinality Cardinality /// Overriders of this property should never return . /// /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public virtual Expression> Constraint { get diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs index 3e7dfa2df8ed10..fd8733b6a3cf49 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs @@ -188,7 +188,6 @@ private ICollection GetNormalizedCollection(Type itemType, object? insta return CollectionServices.GetCollectionWrapper(itemType, collectionObject); } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void EnsureCollectionIsWritable(ICollection? collection) { bool isReadOnly = true; @@ -221,7 +220,6 @@ private void EnsureCollectionIsWritable(ICollection? collection) } } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void PopulateCollection(ICollection collection, IEnumerable values) { if (collection == null) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs index 356575699af209..3c227852ef3a30 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs @@ -522,7 +522,6 @@ private bool TryGetImportValue(ImportDefinition definition, out object? value) return false; } - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void NotifyImportSatisfied() { if (_invokeImportsSatisfied) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs index 5cce60871db19b..bb7791d13d3a98 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs @@ -131,7 +131,6 @@ internal bool IsDisposalRequired } } - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public override ComposablePart CreatePart() { if (IsDisposalRequired) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs index 3b4b6b572b4d95..742d46248be553 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs @@ -124,7 +124,6 @@ public static ContractBasedImportDefinition GetExportFactoryProductImportDefinit return partCreatorImportDefinition.ProductImportDefinition; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ComposablePartDefinition CreatePartDefinition( Lazy partType, bool isDisposalRequired, @@ -145,7 +144,6 @@ public static ComposablePartDefinition CreatePartDefinition( origin)); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ExportDefinition CreateExportDefinition( LazyMemberInfo exportingMember, string contractName, @@ -161,7 +159,6 @@ public static ExportDefinition CreateExportDefinition( origin); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -175,7 +172,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( return CreateImportDefinition(importingMember, contractName, requiredTypeIdentity, requiredMetadata, cardinality, isRecomposable, requiredCreationPolicy, MetadataServices.EmptyMetadata, false, origin); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -202,7 +198,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( origin); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( LazyMemberInfo importingMember, string contractName, @@ -250,7 +245,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( Lazy parameter, string contractName, @@ -263,7 +257,6 @@ public static ContractBasedImportDefinition CreateImportDefinition( return CreateImportDefinition(parameter, contractName, requiredTypeIdentity, requiredMetadata, cardinality, requiredCreationPolicy, MetadataServices.EmptyMetadata, false, origin); } - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public static ContractBasedImportDefinition CreateImportDefinition( Lazy parameter, string contractName, diff --git a/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs b/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs deleted file mode 100644 index 4175d277014aa4..00000000000000 --- a/src/libraries/System.ComponentModel.Primitives/src/FxCopBaseline.cs +++ /dev/null @@ -1,7 +0,0 @@ -// 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. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ComponentModel.Component.#Dispose(System.Boolean)")] diff --git a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj index 78bc218a4526cf..53e44fa05eac16 100644 --- a/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj +++ b/src/libraries/System.ComponentModel.Primitives/src/System.ComponentModel.Primitives.csproj @@ -34,9 +34,6 @@ - - - diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs index 9f265671bc251c..b68c4666a1b40f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AmbientValueAttribute.cs @@ -10,7 +10,6 @@ namespace System.ComponentModel /// Specifies the ambient value for a property. The ambient value is the value you /// can set into a property to make it inherit its ambient. /// - [SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")] [AttributeUsage(AttributeTargets.All)] public sealed class AmbientValueAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs index 5ee2e185d516b8..d7671a15bfa15f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeCollection.cs @@ -6,8 +6,6 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.AttributeCollection")] - namespace System.ComponentModel { /// @@ -121,7 +119,6 @@ public static AttributeCollection FromExisting(AttributeCollection existing, par /// /// Gets the attributes collection. /// - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Matches constructor input type")] protected virtual Attribute[] Attributes => _attributes; /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs index d1c8cf7c7927e6..f6124b19dc91be 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/AttributeProviderAttribute.cs @@ -6,7 +6,6 @@ namespace System.ComponentModel { - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property)] public class AttributeProviderAttribute : Attribute { diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs index e299b2791f765b..8af3871637bc5a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/BindingList.cs @@ -9,8 +9,6 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -[assembly: SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "System.ComponentModel.BindingList`1")] - namespace System.ComponentModel { [Serializable] @@ -305,7 +303,6 @@ object IBindingList.AddNew() /// supply a custom item to add to the list. Otherwise an item of type T is created. /// The new item is then added to the end of the list. /// - [SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] protected virtual object AddNewCore() { // Allow event handler to supply the new item for us diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs index 599153fe0317ff..f80f2c00babdd0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerOptionService.cs @@ -225,7 +225,6 @@ public PropertyDescriptorCollection Properties /// public DesignerOptionCollection this[int index] { - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] get { EnsurePopulated(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs index 8751c702ab4d14..297cbc32fee891 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesignerVerb.cs @@ -15,7 +15,6 @@ public class DesignerVerb : MenuCommand /// /// Initializes a new instance of the class. /// - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public DesignerVerb(string text, EventHandler handler) : base(handler, StandardCommands.VerbFirst) { Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); @@ -25,7 +24,6 @@ public DesignerVerb(string text, EventHandler handler) : base(handler, StandardC /// Initializes a new instance of the /// class. /// - [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")] public DesignerVerb(string text, EventHandler handler, CommandID startCommandID) : base(handler, startCommandID) { Properties["Text"] = text == null ? null : Regex.Replace(text, @"\(\&.\)", ""); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs index ff50426fbeffc5..82a1f3bd8fe8ce 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContextSerializer.cs @@ -30,7 +30,6 @@ public static void Serialize(Stream o, string cryptoKey, DesigntimeLicenseContex formatter.Serialize(o, new object[] { cryptoKey, context._savedLicenseKeys }); } - [SuppressMessage("Microsoft.Security", "CA2107:ReviewDenyAndPermitOnlyUsage")] // Use of PermitOnly here is appropriate. internal static void Deserialize(Stream o, string cryptoKey, RuntimeLicenseContext context) { IFormatter formatter = new BinaryFormatter(); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs index 9f16502f83c300..77b3e5da270871 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/MenuCommand.cs @@ -157,7 +157,6 @@ public virtual void Invoke() /// Provides notification and is called in response to /// a event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")] // Safe: FullTrust LinkDemand to instantiate an object of this class. protected virtual void OnCommandChanged(EventArgs e) => CommandChanged?.Invoke(this, e); /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs index a85b08a76d28f5..6d0860e3d96152 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/PropertyTabAttribute.cs @@ -5,8 +5,6 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.PropertyTabAttribute.get_TabClasses():System.Type[]")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs index 3ea1facf0684ab..c5bceb6e9d450a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/Serialization/MemberRelationshipService.cs @@ -35,7 +35,6 @@ public abstract class MemberRelationshipService /// can also be passed as the property value, in which case the relationship will /// be cleared. /// - [SuppressMessage("Microsoft.Design", "CA1043:UseIntegralOrStringArgumentForIndexers")] public MemberRelationship this[MemberRelationship source] { get @@ -71,7 +70,6 @@ public MemberRelationship this[MemberRelationship source] /// Also sets a relationship between two objects. Null can be passed as the property value, in which /// case the relationship will be cleared. /// - [SuppressMessage("Microsoft.Design", "CA1023:IndexersShouldNotBeMultidimensional")] public MemberRelationship this[object sourceOwner, MemberDescriptor sourceMember] { get diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs index ee6b5fea0ad19c..49249ceed18dba 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/EventDescriptorCollection.cs @@ -7,8 +7,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.EventDescriptorCollection")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs index dab1d1938ca6a4..106ae55d13f1f0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingList.cs @@ -5,8 +5,6 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "System.ComponentModel.IBindingList")] - namespace System.ComponentModel { public interface IBindingList : IList diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs index 79031f8debce70..71e99da62c89dd 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IBindingListView.cs @@ -6,7 +6,6 @@ namespace System.ComponentModel { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public interface IBindingListView : IBindingList { void ApplySort(ListSortDescriptionCollection sorts); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs index 85c0407ed2c482..9b804c646a5013 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/IIntellisenseBuilder.cs @@ -21,7 +21,6 @@ public interface IIntellisenseBuilder /// value - expression being edited /// newValue - return the new value /// - [SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] bool Show(string language, string value, ref string newValue); } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs index ba482a87eadeaa..61edcc5982efd3 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/InstallerTypeAttribute.cs @@ -4,8 +4,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.InstallerTypeAttribute.get_InstallerType():System.Type")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs index de6c1692ec7fdc..c027d8f52196d2 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseException.cs @@ -13,7 +13,6 @@ namespace System.ComponentModel /// [Serializable] [TypeForwardedFrom("System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - [SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors")] // must not, a Type is required in all constructors. public class LicenseException : SystemException { private const int LicenseHResult = unchecked((int)0x80131901); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs index 18631cf320a087..de1b27431ec30a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/LicenseProviderAttribute.cs @@ -52,7 +52,6 @@ public LicenseProviderAttribute(Type type) /// public Type LicenseProvider { - [SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] get { if (_licenseProviderType == null && _licenseProviderName != null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs index 33669a24e1639c..7d1a3a4d3132ac 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ListChangedEventArgs.cs @@ -5,9 +5,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.Int32,System.ComponentModel.PropertyDescriptor)")] -[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.ComponentModel.PropertyDescriptor)")] - namespace System.ComponentModel { public class ListChangedEventArgs : EventArgs diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs index 5149b75f0efe95..5538f600a60858 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MarshalByValueComponent.cs @@ -60,7 +60,6 @@ public virtual ISite Site /// /// Disposes of the resources (other than memory) used by the component. /// - [SuppressMessage("Microsoft.Usage", "CA2213:DisposableFieldsShouldBeDisposed")] public void Dispose() { Dispose(true); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs index bdfdfaac32ad6d..f60ac9f532d6d0 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MaskedTextProvider.cs @@ -468,7 +468,6 @@ private void Initialize() /// Derived classes can override this method and call base.Clone to get proper cloning semantics but must /// implement the full-parameter constructor (passing parameters to the base constructor as well). /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods")] public object Clone() { MaskedTextProvider clonedProvider; @@ -1177,7 +1176,6 @@ public int FindUnassignedEditPositionFrom(int position, bool direction) /// from the specified position included. /// Returns InvalidIndex if it doesn't find one. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow")] public int FindUnassignedEditPositionInRange(int startPosition, int endPosition, bool direction) { int position; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs index cb3d17a2dc459a..4bcf0ac15dec6f 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/MultilineStringConverter.cs @@ -9,7 +9,6 @@ namespace System.ComponentModel /// /// Provides a type converter to convert multiline strings to a simple string. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] public class MultilineStringConverter : TypeConverter { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs index ca110bf65b1186..e0128a7c28f68d 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptor.cs @@ -378,7 +378,6 @@ protected Type GetTypeFromName(string typeName) /// This should be called by your property descriptor implementation /// when the property value has changed. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers")] protected virtual void OnValueChanged(object component, EventArgs e) { if (component != null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs index 1479542b17d63f..2a2d2a319dd9d1 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/PropertyDescriptorCollection.cs @@ -7,11 +7,6 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IDictionary.Add(System.Object,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IList.set_Item(System.Int32,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Scope = "member", Target = "System.ComponentModel.PropertyDescriptorCollection.System.Collections.IDictionary.set_Item(System.Object,System.Object):System.Void")] -[assembly: SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields", Scope = "type", Target = "System.ComponentModel.PropertyDescriptorCollection")] - namespace System.ComponentModel { /// @@ -22,7 +17,6 @@ public class PropertyDescriptorCollection : ICollection, IList, IDictionary /// /// An empty PropertyDescriptorCollection that can used instead of creating a new one with no items. /// - [SuppressMessage("Microsoft.Security", "CA2112:SecuredTypesShouldNotExposeFields")] public static readonly PropertyDescriptorCollection Empty = new PropertyDescriptorCollection(null, true); private IDictionary _cachedFoundProperties; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs index 588729c5741e77..28cb56fa0a9a2a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/ToolboxItemAttribute.cs @@ -4,8 +4,6 @@ using System.Diagnostics.CodeAnalysis; -[assembly: SuppressMessage("Microsoft.Security", "CA2113:SecureLateBindingMethods", Scope = "member", Target = "System.ComponentModel.ToolboxItemAttribute.get_ToolboxItemType():System.Type")] - namespace System.ComponentModel { /// diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs index 046d5fd9984405..ed746442c1f77a 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeConverter.cs @@ -146,7 +146,6 @@ public string ConvertToInvariantString(object value) /// /// Converts the specified value to a culture-invariant string representation. /// - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] public string ConvertToInvariantString(ITypeDescriptorContext context, object value) { return ConvertToString(context, CultureInfo.InvariantCulture, value); diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs index b63ab0d5ef335b..6d91d412d2ce76 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/TypeDescriptor.cs @@ -2598,8 +2598,6 @@ internal ComNativeDescriptionProvider(IComNativeDescriptorHandler handler) /// Implements GetTypeDescriptor. This creates a custom type /// descriptor that walks the linked list for each of its calls. /// - - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) { if (objectType == null) @@ -3163,7 +3161,6 @@ public override Type GetRuntimeType(Type objectType) /// Implements GetTypeDescriptor. This creates a custom type /// descriptor that walks the linked list for each of its calls. /// - [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters")] public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) { if (objectType == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs index a9d727b046116c..2a83103ed8384b 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/ColorConverter.cs @@ -36,7 +36,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs index 5197af31bd4501..55a9cf179060d5 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/PointConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -103,8 +102,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs index 6dd107f7dc9766..1c4cf21559b261 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/RectangleConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -106,8 +105,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs index 9592c8fdad39ef..9c0eefe0b829d6 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -101,8 +100,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] - [SuppressMessage("Microsoft.Security", "CA2102:CatchNonClsCompliantExceptionsInGeneralHandlers")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs index 3eafc9940c0101..1bb8a8698d7514 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/Drawing/SizeFConverter.cs @@ -23,7 +23,6 @@ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinati return destinationType == typeof(InstanceDescriptor) || base.CanConvertTo(context, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string strValue) @@ -60,7 +59,6 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c return base.ConvertFrom(context, culture, value); } - [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) @@ -99,7 +97,6 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul return base.ConvertTo(context, culture, value, destinationType); } - [SuppressMessage("Microsoft.Performance", "CA1808:AvoidCallsThatBoxValueTypes")] public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { if (propertyValues == null) diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs index 5de9c6bbe355c5..809ece1425c030 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/Resources/TestResx.Designer.cs @@ -29,7 +29,6 @@ internal class TestResx { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TestResx() { } diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs index 7a6602b17c1d80..319384b3b756f3 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a type, property, field, or method provides a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = true, Inherited = false)] public class ExportAttribute : Attribute diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs index a709cfa4a8b758..38bce0e92af489 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a property, field, or parameter imports a particular export. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportAttribute : Attribute diff --git a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs index 5db7370db3792e..2e260d02e5e18c 100644 --- a/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs +++ b/src/libraries/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs @@ -9,7 +9,6 @@ namespace System.Composition /// /// Specifies that a property, field, or parameter imports a particular set of exports. /// - [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")] [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public class ImportManyAttribute : Attribute diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs index 4820ae4e1a78a1..c3db3f3caa4588 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorProvider.cs @@ -19,19 +19,16 @@ public abstract class ExportDescriptorProvider /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly IEnumerable NoExportDescriptors = Enumerable.Empty(); /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly IDictionary NoMetadata = new ReadOnlyDictionary(new Dictionary()); /// /// Constant value provided so that subclasses can avoid creating additional duplicate values. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] protected static readonly Func> NoDependencies = () => Enumerable.Empty(); /// diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs b/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs index b5517858628fd4..765402a2308cdf 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/tests/Resources/Strings.Designer.cs @@ -29,7 +29,6 @@ internal class Strings { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } diff --git a/src/libraries/System.Console/src/FxCopBaseline.cs b/src/libraries/System.Console/src/FxCopBaseline.cs deleted file mode 100644 index a5fac4ae97b6a9..00000000000000 --- a/src/libraries/System.Console/src/FxCopBaseline.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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 - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Dispose(System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Peek():System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Read():System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#Read(System.Char[],System.Int32,System.Int32):System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadBlock(System.Char[],System.Int32,System.Int32):System.Int32")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadLine():System.String")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadToEnd():System.String")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#ReadKey(System.Boolean&):System.ConsoleKeyInfo")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.IO.SyncTextReader.#get_KeyAvailable():System.Boolean")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#ResetColor()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#TryGetCursorPosition(System.Int32&,System.Int32&,System.Boolean):System.Boolean")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#RefreshColors(System.ConsoleColor&,System.ConsoleColor)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#EnsureInitializedCore()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#WriteStdoutAnsiString(System.String,System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#ForegroundColor")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#BackgroundColor")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#SetCursorPosition(System.Int32,System.Int32)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#GetWindowSize(System.Int32&,System.Int32&)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.ConsolePal.#UpdatedCachedCursorPosition(System.Byte*,System.Int32,System.Int32)")] diff --git a/src/libraries/System.Console/src/System.Console.csproj b/src/libraries/System.Console/src/System.Console.csproj index 79f3023d5ba468..c24b37c5cfb1d1 100644 --- a/src/libraries/System.Console/src/System.Console.csproj +++ b/src/libraries/System.Console/src/System.Console.csproj @@ -6,9 +6,6 @@ $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix enable - - - diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs index 4d85b611d786e5..87d3e1a4f7c1ce 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnection.cs @@ -882,7 +882,6 @@ internal bool TestRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) } // suppress this message - we cannot use SafeHandle here. Also, see notes in the code (VSTFDEVDIV# 560355) - [SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { DbTransaction transaction = InnerConnection.BeginTransaction(isolationLevel); diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnection.cs b/src/libraries/System.Data.OleDb/src/OleDbConnection.cs index 3a9a17c7e897f1..acf111fbbcb0e0 100644 --- a/src/libraries/System.Data.OleDb/src/OleDbConnection.cs +++ b/src/libraries/System.Data.OleDb/src/OleDbConnection.cs @@ -366,7 +366,6 @@ private void DisposeMe(bool disposing) } // suppress this message - we cannot use SafeHandle here. - [SuppressMessage("Microsoft.Reliability", "CA2004:RemoveCallsToGCKeepAlive")] protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel) { DbTransaction transaction = InnerConnection.BeginTransaction(isolationLevel); diff --git a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs index d0a8669c091101..aaba1bededf59c 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbConnectionPool.cs @@ -1104,7 +1104,6 @@ internal bool TryGetConnection(DbConnection owningObject, TaskCompletionSource - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public sealed class EventOpcode { private readonly int _value; diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs index 65d7c38180674c..dfb656706b289f 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/EventRecord.cs @@ -18,7 +18,6 @@ public abstract class EventRecord : IDisposable public abstract byte? Level { get; } public abstract int? Task { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public abstract short? Opcode { get; } public abstract long? Keywords { get; } @@ -43,7 +42,6 @@ public abstract class EventRecord : IDisposable public abstract string LevelDisplayName { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public abstract string OpcodeDisplayName { get; } public abstract string TaskDisplayName { get; } public abstract IEnumerable KeywordsDisplayNames { get; } diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs index b77b4d76378dc1..0464e2f60a3823 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadata.cs @@ -436,7 +436,6 @@ public IList Levels } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public IList Opcodes { get diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs index 98a40058fe81ce..95bffd3b390462 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/Winmeta.cs @@ -51,7 +51,6 @@ public enum StandardEventTask /// /// EventOpcode /// - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "matell: Shipped public in 3.5, breaking change to fix now.")] public enum StandardEventOpcode { /// diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs index 017b0f2a0e8d1e..885a54cf989477 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PrivilegedConfigurationManager.cs @@ -9,7 +9,6 @@ namespace System.Configuration { internal static class PrivilegedConfigurationManager { internal static ConnectionStringSettingsCollection ConnectionStrings { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] get { return ConfigurationManager.ConnectionStrings; } diff --git a/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs deleted file mode 100644 index 1d3b6208e1bbec..00000000000000 --- a/src/libraries/System.Diagnostics.Process/src/FxCopBaseline.cs +++ /dev/null @@ -1,11 +0,0 @@ -// 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. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#EnsureWatchingForExit()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#RaiseOnExited()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#StopWatchingForExit()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.#CompletionCallback(System.Object,System.Boolean)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.Process.Close()")] \ No newline at end of file diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index 094822269db9ff..24550f43ab91cb 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -12,9 +12,6 @@ $(NoWarn);0649 - - - diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs deleted file mode 100644 index d7c7e4f0a47181..00000000000000 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/FxCopBaseline.cs +++ /dev/null @@ -1,7 +0,0 @@ -// 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. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.DelimitedListTraceListener.#set_Delimiter(System.String)")] diff --git a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj index 5747595d38323f..f326d869012406 100644 --- a/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj +++ b/src/libraries/System.Diagnostics.TextWriterTraceListener/src/System.Diagnostics.TextWriterTraceListener.csproj @@ -4,9 +4,6 @@ System.Diagnostics.TextWriterTraceListener $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix - - - diff --git a/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs b/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs deleted file mode 100644 index 89cdfb87de27dc..00000000000000 --- a/src/libraries/System.Diagnostics.TraceSource/src/FxCopBaseline.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Flush()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#Flush()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object[])")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceTransfer(System.Int32,System.String,System.Guid)")] diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj b/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj index ffe75a98929dea..65fa3210771717 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj +++ b/src/libraries/System.Diagnostics.TraceSource/src/System.Diagnostics.TraceSource.csproj @@ -5,9 +5,6 @@ $(DefineConstants);TRACE $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX - - - diff --git a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs index 2b77b373412e32..4d1e26134ae4e5 100644 --- a/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs +++ b/src/libraries/System.Diagnostics.TraceSource/src/System/Diagnostics/Switch.cs @@ -34,7 +34,6 @@ public abstract class Switch private object InitializedLock { - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread-safety")] get { if (_initializedLock == null) @@ -140,7 +139,6 @@ public StringDictionary Attributes /// protected int SwitchSetting { - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")] get { if (!_initialized) @@ -150,7 +148,6 @@ protected int SwitchSetting } return _switchSetting; } - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")] set { bool didUpdate = false; diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs index 9a238043730a63..e46c9b8574ae72 100644 --- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs +++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.cs @@ -68,7 +68,6 @@ public static partial class ZipFile /// If the file exists and is not a Zip file, a ZipArchiveException will be thrown. /// If the file exists and is empty or does not exist, a new Zip file will be created. /// Note that creating a Zip file with the ZipArchiveMode.Create mode is more efficient when creating a new Zip file. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] // See comment in the body. public static ZipArchive Open(string archiveFileName, ZipArchiveMode mode) => Open(archiveFileName, mode, entryNameEncoding: null); /// @@ -145,7 +144,6 @@ public static partial class ZipFile /// Note that Unicode encodings other than UTF-8 may not be currently used for the entryNameEncoding, /// otherwise an is thrown. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] // See comment in the body. public static ZipArchive Open(string archiveFileName, ZipArchiveMode mode, Encoding? entryNameEncoding) { // Relies on FileStream's ctor for checking of archiveFileName diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs index 063fc39d6a0088..e48c9e731ef4dd 100644 --- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs +++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchiveEntry.cs @@ -10,7 +10,6 @@ namespace System.IO.Compression { // The disposable fields that this class owns get disposed when the ZipArchive it belongs to gets disposed - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] public partial class ZipArchiveEntry { // The maximum index of our buffers, from the maximum index of a byte array diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs index 79e3c5e11a9c01..9a69d22219df01 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs @@ -472,7 +472,6 @@ private void NotifyFileSystemEventArgs(WatcherChangeTypes changeType, string nam /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnChanged(FileSystemEventArgs e) { InvokeOn(e, _onChangedHandler); @@ -481,7 +480,6 @@ protected void OnChanged(FileSystemEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnCreated(FileSystemEventArgs e) { InvokeOn(e, _onCreatedHandler); @@ -490,7 +488,6 @@ protected void OnCreated(FileSystemEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnDeleted(FileSystemEventArgs e) { InvokeOn(e, _onDeletedHandler); @@ -511,7 +508,6 @@ private void InvokeOn(FileSystemEventArgs e, FileSystemEventHandler? handler) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnError(ErrorEventArgs e) { ErrorEventHandler? handler = _onErrorHandler; @@ -528,7 +524,6 @@ protected void OnError(ErrorEventArgs e) /// /// Raises the event. /// - [SuppressMessage("Microsoft.Security", "CA2109:ReviewVisibleEventHandlers", MessageId = "0#", Justification = "Changing from protected to private would be a breaking change")] protected void OnRenamed(RenamedEventArgs e) { RenamedEventHandler? handler = _onRenamedHandler; diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs index 77bd42e4aa6ffe..94057cc6c5d8fe 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeClientStream.cs @@ -13,13 +13,11 @@ namespace System.IO.Pipes /// public sealed partial class AnonymousPipeClientStream : PipeStream { - [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string", Justification = "By design")] public AnonymousPipeClientStream(string pipeHandleAsString) : this(PipeDirection.In, pipeHandleAsString) { } - [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "string", Justification = "By design")] public AnonymousPipeClientStream(PipeDirection direction, string pipeHandleAsString) : base(direction, 0) { diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs index ea0f58f4dacad6..1834f98363d7f7 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/AnonymousPipeServerStream.cs @@ -88,7 +88,6 @@ public AnonymousPipeServerStream(PipeDirection direction, HandleInheritability i // This method should exist until we add a first class way of passing handles between parent and child // processes. For now, people do it via command line arguments. - [SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle", Justification = "By design")] public string GetClientHandleAsString() { _clientHandleExposed = true; diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs index 584a69bcdce27d..cfee043d439585 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Unix.cs @@ -69,7 +69,6 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) public int NumberOfServerInstances { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs index e1d28d721cd233..b6689f746acdb0 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.Windows.cs @@ -110,7 +110,6 @@ private bool TryConnect(int timeout, CancellationToken cancellationToken) public unsafe int NumberOfServerInstances { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs index 7a988f415ff912..994296f42f3eec 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs @@ -135,7 +135,6 @@ private void Create(string pipeName, PipeDirection direction, int maxNumberOfSer // was called (but not before this server is been created, or, if we were servicing another client, // not before we called Disconnect), in which case, there may be some buffer already in the pipe waiting // for us to read. See NamedPipeClientStream.Connect for more information. - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] public void WaitForConnection() { CheckConnectOperationsServerWithHandle(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs index d4cae06073fdd2..51e73721f678a0 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.cs @@ -184,7 +184,6 @@ public void EndWaitForConnection(IAsyncResult asyncResult) => TaskToApm.End(asyncResult); // Server can only connect from Disconnected state - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Consistent with security model")] private void CheckConnectOperationsServer() { // we're not checking whether already connected; this allows us to throw IOException diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs index 10556bcf2c56a7..96994ab706ed8c 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Unix.cs @@ -237,7 +237,6 @@ public void WaitForPipeDrain() // override this in cases where only one mode is legal (such as anonymous pipes) public virtual PipeTransmissionMode TransmissionMode { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -249,7 +248,6 @@ public virtual PipeTransmissionMode TransmissionMode // access. If that passes, call to GetNamedPipeInfo will succeed. public virtual int InBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] get { CheckPipePropertyOperations(); @@ -267,7 +265,6 @@ public virtual int InBufferSize // the ctor. public virtual int OutBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -286,7 +283,6 @@ public virtual PipeTransmissionMode ReadMode CheckPipePropertyOperations(); return PipeTransmissionMode.Byte; // Unix pipes are only byte-based, not message-based } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] set { CheckPipePropertyOperations(); diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs index c79bdc7dec73e6..8a9a34eb2dc8f8 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.Windows.cs @@ -198,7 +198,6 @@ public void WaitForPipeDrain() // override this in cases where only one mode is legal (such as anonymous pipes) public unsafe virtual PipeTransmissionMode TransmissionMode { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -230,7 +229,6 @@ public unsafe virtual PipeTransmissionMode TransmissionMode // access. If that passes, call to GetNamedPipeInfo will succeed. public unsafe virtual int InBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands")] get { CheckPipePropertyOperations(); @@ -255,7 +253,6 @@ public unsafe virtual int InBufferSize // the ctor. public unsafe virtual int OutBufferSize { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { CheckPipePropertyOperations(); @@ -293,7 +290,6 @@ public virtual PipeTransmissionMode ReadMode } return _readMode; } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] set { // Nothing fancy here. This is just a wrapper around the Win32 API. Note, that NamedPipeServerStream diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs index b8e684df509e3e..b2d786b38fe260 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs @@ -424,7 +424,6 @@ public bool IsAsync // message, otherwise it is set to true. public bool IsMessageComplete { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { // omitting pipe broken exception to allow reader to finish getting message @@ -465,7 +464,6 @@ internal void UpdateMessageCompletion(bool completion) public SafePipeHandle SafePipeHandle { - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Security model of pipes: demand at creation but no subsequent demands")] get { if (_handle == null) diff --git a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs index 56cf3b7661377c..487b8b5d08a96d 100644 --- a/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs +++ b/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Windows.cs @@ -1581,7 +1581,6 @@ internal bool ShutdownLoop } // This is the blocking method that waits for an event to occur. It wraps the SDK's WaitCommEvent function. - [SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Justification = "this is debug-only code")] internal unsafe void WaitForCommEvent() { int unused = 0; diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs index 1c26e42fd6cbd4..d0a70537a5f0e0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs @@ -75,7 +75,6 @@ public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicM /// internal override sealed bool IsStandardBinder => true; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] internal static bool OperationIsValid(ExpressionType operation) { switch (operation) diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs index 54425b6ee37112..12d2aaa6ca7cdd 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs @@ -21,7 +21,6 @@ public abstract class BindingRestrictions /// /// Represents an empty set of binding restrictions. This field is read-only. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] public static readonly BindingRestrictions Empty = new CustomRestriction(AstUtils.Constant(true)); private const int TypeRestrictionHash = 0b_0100_1001_0010_0100_1001_0010_0100_1001; diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs index 7fddcbf488112d..ac7ac073ba180d 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs @@ -27,7 +27,6 @@ protected ConvertBinder(Type type, bool @explicit) /// /// The type to convert to. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] public Type Type { get; } /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObject.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObject.cs index 150d3d4e912dfc..05274c014efbcc 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObject.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObject.cs @@ -17,7 +17,6 @@ public class DynamicMetaObject /// /// Represents an empty array of type . This field is read-only. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] public static readonly DynamicMetaObject[] EmptyMetaObjects = Array.Empty(); /// @@ -246,7 +245,6 @@ public virtual DynamicMetaObject BindBinaryOperation(BinaryOperationBinder binde /// Returns the enumeration of all dynamic member names. /// /// The list of dynamic member names. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public virtual IEnumerable GetDynamicMemberNames() => Array.Empty(); /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs index 9e9390e4b7badc..08b2f28322b093 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs @@ -176,7 +176,6 @@ private static DynamicMetaObject[] CreateArgumentMetaObjects(object[] args, Read /// /// The Type property of the resulting expression; any type is allowed. /// The update expression. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] public Expression GetUpdateExpression(Type type) { return Expression.Goto(CallSiteBinder.UpdateLabel, type); diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs index dca9930937e4fd..9ffdba55bad37c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs @@ -47,7 +47,6 @@ protected DynamicObject() /// The binder provided by the call site. /// The result of the get operation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryGetMember(GetMemberBinder binder, out object? result) { result = null; @@ -82,7 +81,6 @@ public virtual bool TryGetMember(GetMemberBinder binder, out object? result) /// The arguments to be used for the invocation. /// The result of the invocation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryInvokeMember(InvokeMemberBinder binder, object?[]? args, out object? result) { result = null; @@ -97,7 +95,6 @@ public virtual bool TryInvokeMember(InvokeMemberBinder binder, object?[]? args, /// The binder provided by the call site. /// The result of the conversion. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryConvert(ConvertBinder binder, out object? result) { result = null; @@ -113,7 +110,6 @@ public virtual bool TryConvert(ConvertBinder binder, out object? result) /// The arguments used for creation. /// The created instance. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryCreateInstance(CreateInstanceBinder binder, object?[]? args, [NotNullWhen(true)] out object? result) { result = null; @@ -129,7 +125,6 @@ public virtual bool TryCreateInstance(CreateInstanceBinder binder, object?[]? ar /// The arguments to be used for the invocation. /// The result of the invocation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryInvoke(InvokeBinder binder, object?[]? args, out object? result) { result = null; @@ -145,7 +140,6 @@ public virtual bool TryInvoke(InvokeBinder binder, object?[]? args, out object? /// The right operand for the operation. /// The result of the operation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryBinaryOperation(BinaryOperationBinder binder, object arg, out object? result) { result = null; @@ -160,7 +154,6 @@ public virtual bool TryBinaryOperation(BinaryOperationBinder binder, object arg, /// The binder provided by the call site. /// The result of the operation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryUnaryOperation(UnaryOperationBinder binder, out object? result) { result = null; @@ -176,7 +169,6 @@ public virtual bool TryUnaryOperation(UnaryOperationBinder binder, out object? r /// The indexes to be used. /// The result of the operation. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object? result) { result = null; @@ -192,7 +184,6 @@ public virtual bool TryGetIndex(GetIndexBinder binder, object[] indexes, out obj /// The indexes to be used. /// The value to set. /// true if the operation is complete, false if the call site should determine behavior. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate")] public virtual bool TrySetIndex(SetIndexBinder binder, object[] indexes, object? value) => false; /// @@ -209,7 +200,6 @@ public virtual bool TryGetIndex(GetIndexBinder binder, object[] indexes, out obj /// Returns the enumeration of all dynamic member names. /// /// The list of dynamic member names. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public virtual IEnumerable GetDynamicMemberNames() => Array.Empty(); #endregion diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs index c2ba210556d47c..5d1d74c59d7db0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoObject.cs @@ -18,7 +18,6 @@ namespace System.Dynamic /// /// Represents an object with members that can be dynamically added and removed at runtime. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public sealed class ExpandoObject : IDynamicMetaObjectProvider, IDictionary, INotifyPropertyChanged { private static readonly MethodInfo s_expandoTryGetValue = diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs index 60b50670106b8c..e6b2526325ef1d 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs @@ -146,7 +146,6 @@ internal static TRet UpdateAndExecute1(CallSite site, T0 arg0) } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch1(CallSite site, T0 arg0) { site._match = false; @@ -292,7 +291,6 @@ internal static TRet UpdateAndExecute2(CallSite site, T0 arg0, T1 } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch2(CallSite site, T0 arg0, T1 arg1) { site._match = false; @@ -438,7 +436,6 @@ internal static TRet UpdateAndExecute3(CallSite site, T0 arg0, } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch3(CallSite site, T0 arg0, T1 arg1, T2 arg2) { site._match = false; @@ -584,7 +581,6 @@ internal static TRet UpdateAndExecute4(CallSite site, T0 a } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { site._match = false; @@ -730,7 +726,6 @@ internal static TRet UpdateAndExecute5(CallSite site, } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { site._match = false; @@ -876,7 +871,6 @@ internal static TRet UpdateAndExecute6(CallSite si } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch6(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { site._match = false; @@ -1022,7 +1016,6 @@ internal static TRet UpdateAndExecute7(CallSit } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch7(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { site._match = false; @@ -1168,7 +1161,6 @@ internal static TRet UpdateAndExecute8(Cal } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch8(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) { site._match = false; @@ -1314,7 +1306,6 @@ internal static TRet UpdateAndExecute9 } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch9(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) { site._match = false; @@ -1460,7 +1451,6 @@ internal static TRet UpdateAndExecute10.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch10(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) { site._match = false; @@ -1605,7 +1595,6 @@ internal static void UpdateAndExecuteVoid1(CallSite site, T0 arg0) } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid1(CallSite site, T0 arg0) { site._match = false; @@ -1750,7 +1739,6 @@ internal static void UpdateAndExecuteVoid2(CallSite site, T0 arg0, T1 ar } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid2(CallSite site, T0 arg0, T1 arg1) { site._match = false; @@ -1895,7 +1883,6 @@ internal static void UpdateAndExecuteVoid3(CallSite site, T0 arg0, T } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid3(CallSite site, T0 arg0, T1 arg1, T2 arg2) { site._match = false; @@ -2040,7 +2027,6 @@ internal static void UpdateAndExecuteVoid4(CallSite site, T0 arg } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { site._match = false; @@ -2185,7 +2171,6 @@ internal static void UpdateAndExecuteVoid5(CallSite site, T0 } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { site._match = false; @@ -2330,7 +2315,6 @@ internal static void UpdateAndExecuteVoid6(CallSite site } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid6(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { site._match = false; @@ -2475,7 +2459,6 @@ internal static void UpdateAndExecuteVoid7(CallSite } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid7(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { site._match = false; @@ -2620,7 +2603,6 @@ internal static void UpdateAndExecuteVoid8(CallS } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid8(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) { site._match = false; @@ -2765,7 +2747,6 @@ internal static void UpdateAndExecuteVoid9(C } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid9(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) { site._match = false; @@ -2910,7 +2891,6 @@ internal static void UpdateAndExecuteVoid10.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid10(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) { site._match = false; diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt index 7a1ab2161c77a6..b4d8edcbbf7359 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.tt @@ -160,7 +160,6 @@ for (int i = 1; i <= 10; i++) } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static TRet NoMatch<#=i#><<#=genericParameters#>>(<#=parameters#>) { site._match = false; @@ -316,7 +315,6 @@ for (int i = 1; i <= 10; i++) } [Obsolete("pregenerated CallSite.Update delegate", error: true)] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters")] internal static void NoMatchVoid<#=i#><<#=genericParameters#>>(<#=parameters#>) { site._match = false; diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs index 97a14bfe568208..a58784f170a9a7 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs @@ -658,7 +658,6 @@ public static bool IsImplicitlyConvertibleTo(this Type source, Type destination) return null; } - [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private static bool IsImplicitNumericConversion(Type source, Type destination) { TypeCode tcSource = source.GetTypeCode(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs index 1057bd05b156eb..f712158e6c9ea3 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs @@ -877,7 +877,6 @@ public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression /// A MethodInfo that specifies the implementing method. /// A LambdaExpression that represents a type conversion function. This parameter is used if binaryType is Coalesce or compound assignment. /// The BinaryExpression that results from calling the appropriate factory method. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static BinaryExpression MakeBinary(ExpressionType binaryType, Expression left, Expression right, bool liftToNull, MethodInfo? method, LambdaExpression? conversion) => binaryType switch { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/BoundConstants.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/BoundConstants.cs index 491f944409659e..7ede725cdd1f9e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/BoundConstants.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/BoundConstants.cs @@ -43,7 +43,6 @@ public bool Equals(TypedConstant other) { return object.ReferenceEquals(Value, other.Value) && Type.Equals(other.Type); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2231:OverloadOperatorEqualsOnOverridingValueTypeEquals")] public override bool Equals(object? obj) { return obj is TypedConstant typedConstant && Equals(typedConstant); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs index 300d6599bb550a..64a955e954279f 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs @@ -135,7 +135,6 @@ private static Type TryMakeVBStyledCallSite(Type[] types) /// Creates a new delegate, or uses a func/action /// Note: this method does not cache /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] internal static Type MakeNewDelegate(Type[] types) { Debug.Assert(types != null && types.Length > 0); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/ILGen.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/ILGen.cs index dd26699dc3ec83..17b289b1f58f45 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/ILGen.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/ILGen.cs @@ -323,7 +323,6 @@ internal static void EmitFieldSet(this ILGenerator il, FieldInfo fi) il.Emit(fi.IsStatic ? OpCodes.Stsfld : OpCodes.Stfld, fi); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] internal static void EmitNew(this ILGenerator il, ConstructorInfo ci) { Debug.Assert(ci != null); @@ -696,7 +695,6 @@ private static void EmitCastToType(this ILGenerator il, Type typeFrom, Type type } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private static void EmitNumericConversion(this ILGenerator il, Type typeFrom, Type typeTo, bool isChecked) { TypeCode tc = typeTo.GetTypeCode(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs index faf3b023fed155..4a329e5b8b9767 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs @@ -145,7 +145,6 @@ private void EmitBinaryOperator(ExpressionType op, Type leftType, Type rightType } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void EmitUnliftedBinaryOp(ExpressionType op, Type leftType, Type rightType) { Debug.Assert(!leftType.IsNullableType()); @@ -285,7 +284,6 @@ private void EmitConvertArithmeticResult(ExpressionType op, Type resultType) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void EmitLiftedBinaryOp(ExpressionType op, Type leftType, Type rightType, Type resultType, bool liftedToNull) { Debug.Assert(leftType.IsNullableType() || rightType.IsNullableType()); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs index 93f7737de6b9c1..29c078e4fd9c6d 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs @@ -43,7 +43,6 @@ private void PushLabelBlock(LabelScopeKind type) _labelBlock = new LabelScopeInfo(_labelBlock, type); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "kind")] private void PopLabelBlock(LabelScopeKind kind) { Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs index 14dec38de09363..b0aa4e3fc13438 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs @@ -1109,7 +1109,6 @@ private static Type GetMemberType(MemberInfo member) #region Expression helpers - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void EmitLift(ExpressionType nodeType, Type resultType, MethodCallExpression mc, ParameterExpression[] paramList, Expression[] argList) { Debug.Assert(TypeUtils.AreEquivalent(resultType.GetNonNullableType(), mc.Type.GetNonNullableType())); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Generated.cs index a95d8861e87125..b8ead30a237704 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Generated.cs @@ -11,7 +11,6 @@ partial class LambdaCompiler { private readonly StackGuard _guard = new StackGuard(); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void EmitExpression(Expression node, CompilationFlags flags) { // When compiling deep trees, we run the risk of triggering a terminating StackOverflowException, diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs index c1da9a9e559fca..59af316d2df3eb 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs @@ -454,7 +454,6 @@ private void EmitOrElseBinaryExpression(Expression expr, CompilationFlags flags) /// constant folding over conditionals and logical expressions at the /// tree level. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] private void EmitExpressionAndBranch(bool branchValue, Expression node, Label label) { Debug.Assert(node.Type == typeof(bool)); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs index 1a29c7db9714c3..dce9fdd55b20bd 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs @@ -118,7 +118,6 @@ private void EmitUnary(UnaryExpression node, CompilationFlags flags) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void EmitUnaryOperator(ExpressionType op, Type operandType, Type resultType) { bool operandIsNullable = operandType.IsNullableType(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.cs index 35a70d7169b679..f938538e86567f 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.cs @@ -24,7 +24,6 @@ internal interface ILocalCache /// contain multiple lambdas, the Compiler class is responsible for compiling the whole tree, individual /// lambdas are then compiled by the LambdaCompiler. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal sealed partial class LambdaCompiler : ILocalCache { private static int s_lambdaMethodIndex; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs index 5fb68ca8405d4e..baf14e54a22d87 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs @@ -14,8 +14,6 @@ internal partial class StackSpiller /// Expression to rewrite. /// State of the stack before the expression is emitted. /// Rewritten expression. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1505:AvoidUnmaintainableCode")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private Result RewriteExpression(Expression node, Stack stack) { if (node == null) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs index 1d585106ffb5b3..3514a1973e9ec2 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs @@ -54,7 +54,6 @@ internal partial class StackSpiller /// to detect misuse of the and methods. /// [Conditional("DEBUG")] - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] private void VerifyTemps() => _tm.VerifyTemps(); /// @@ -214,7 +213,6 @@ internal void Free(int mark) /// to detect misuse of the and methods. /// [Conditional("DEBUG")] - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] internal void VerifyTemps() { Debug.Assert(_usedTemps == null || _usedTemps.Count == 0); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DebugViewWriter.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DebugViewWriter.cs index 428a17a1b6c202..59c7e5f64e08cb 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DebugViewWriter.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DebugViewWriter.cs @@ -11,7 +11,6 @@ namespace System.Linq.Expressions { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal sealed class DebugViewWriter : ExpressionVisitor { [Flags] @@ -295,7 +294,6 @@ private void VisitExpressions(char open, char separator, IReadOnlyList exp Out(close.ToString(), Flow.Break); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] protected internal override Expression VisitBinary(BinaryExpression node) { if (node.NodeType == ExpressionType.ArrayIndex) @@ -576,7 +574,6 @@ protected internal override Expression VisitInvocation(InvocationExpression node return node; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private static bool NeedsParentheses(Expression parent, Expression? child) { Debug.Assert(parent != null); @@ -655,7 +652,6 @@ private static bool NeedsParentheses(Expression parent, Expression? child) } // the greater the higher - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private static int GetOperatorPrecedence(Expression node) { // Roughly matches C# operator precedence, with some additional @@ -902,7 +898,6 @@ protected internal override Expression VisitTypeBinary(TypeBinaryExpression node return node; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] protected internal override Expression VisitUnary(UnaryExpression node) { switch (node.NodeType) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs index ef01a6c0436931..91e6801ffc6511 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs @@ -16,7 +16,6 @@ namespace System.Linq.Expressions /// /// The base type for all nodes in Expression Trees. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] public abstract partial class Expression { private static readonly CacheDict s_lambdaDelegateCache = new CacheDict(40); @@ -92,7 +91,6 @@ public virtual ExpressionType NodeType /// /// The of the value represented by this . /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] public virtual Type Type { get diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionStringBuilder.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionStringBuilder.cs index 6abb20cd619578..8f9e739d587635 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionStringBuilder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionStringBuilder.cs @@ -12,7 +12,6 @@ namespace System.Linq.Expressions { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal sealed class ExpressionStringBuilder : ExpressionVisitor { private readonly StringBuilder _out; @@ -143,7 +142,6 @@ private void VisitExpressions(char open, ReadOnlyCollection expressions, c Out(close); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] protected internal override Expression VisitBinary(BinaryExpression node) { if (node.NodeType == ExpressionType.ArrayIndex) @@ -611,7 +609,6 @@ protected internal override Expression VisitTypeBinary(TypeBinaryExpression node return node; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] protected internal override Expression VisitUnary(UnaryExpression node) { switch (node.NodeType) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionVisitor.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionVisitor.cs index a39518cc0d1f35..fa35b659e9453c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionVisitor.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ExpressionVisitor.cs @@ -430,7 +430,6 @@ protected internal virtual Expression VisitNewArray(NewArrayExpression node) /// The expression to visit. /// The modified expression, if it or any subexpression was modified; /// otherwise, returns the original expression. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix")] protected internal virtual Expression VisitNew(NewExpression node) { Expression[]? a = VisitArguments(node); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/AndInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/AndInstruction.cs index bad335ef742a88..a0c074350925dc 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/AndInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/AndInstruction.cs @@ -172,7 +172,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type) => type.GetNonNullableType().GetTypeCode() switch { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/EqualInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/EqualInstruction.cs index d585b927512969..9ed50a4d1f4f84 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/EqualInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/EqualInstruction.cs @@ -508,7 +508,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type, bool liftedToNull) { if (liftedToNull) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ExclusiveOrInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ExclusiveOrInstruction.cs index af1ab58ec5bddd..cebe4a4e0fa503 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ExclusiveOrInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ExclusiveOrInstruction.cs @@ -160,7 +160,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type) => type.GetNonNullableType().GetTypeCode() switch { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InstructionList.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InstructionList.cs index 1c8f1c402ccf7b..5c1fa2ca2a6339 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InstructionList.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InstructionList.cs @@ -13,7 +13,6 @@ namespace System.Linq.Expressions.Interpreter { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] [DebuggerTypeProxy(typeof(InstructionArray.DebugView))] internal readonly struct InstructionArray { @@ -66,7 +65,6 @@ public InstructionList.DebugView.InstructionView[] GetInstructionViews(bool incl } [DebuggerTypeProxy(typeof(InstructionList.DebugView))] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal sealed class InstructionList { private readonly List _instructions = new List(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InterpretedFrame.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InterpretedFrame.cs index c8b45d187c99cf..ccd88605d9ea2b 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InterpretedFrame.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/InterpretedFrame.cs @@ -11,23 +11,19 @@ namespace System.Linq.Expressions.Interpreter { internal sealed class InterpretedFrame { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] [ThreadStatic] private static InterpretedFrame? s_currentFrame; internal readonly Interpreter Interpreter; internal InterpretedFrame? _parent; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] private readonly int[]? _continuations; private int _continuationIndex; private int _pendingContinuation; private object? _pendingValue; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] public readonly object?[] Data; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] public readonly IStrongBox[]? Closure; public int StackIndex; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LeftShiftInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LeftShiftInstruction.cs index f7db0e556f4c05..543d05ea615270 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LeftShiftInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LeftShiftInstruction.cs @@ -160,7 +160,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type) => type.GetNonNullableType().GetTypeCode() switch { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LightCompiler.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LightCompiler.cs index 61520cc3599251..a5c17bd54fff50 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LightCompiler.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LightCompiler.cs @@ -260,12 +260,10 @@ public override string ToString() } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")] internal readonly struct InterpretedFrameInfo { private readonly string? _methodName; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")] private readonly DebugInfo? _debugInfo; public InterpretedFrameInfo(string? methodName, DebugInfo? info) @@ -277,7 +275,6 @@ public InterpretedFrameInfo(string? methodName, DebugInfo? info) public override string? ToString() => _debugInfo != null ? _methodName + ": " + _debugInfo : _methodName; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal sealed class LightCompiler { private readonly InstructionList _instructions; @@ -1787,7 +1784,6 @@ private void PushLabelBlock(LabelScopeKind type) _labelBlock = new LabelScopeInfo(_labelBlock, type); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "kind")] private void PopLabelBlock(LabelScopeKind kind) { Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); @@ -3021,7 +3017,6 @@ private void CompileAsVoid(Expression expr) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private void CompileNoLabelPush(Expression expr) { // When compiling deep trees, we run the risk of triggering a terminating StackOverflowException, diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LocalAccess.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LocalAccess.cs index 5c9f4cfbb809a2..b9c9b0df60e23c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LocalAccess.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/LocalAccess.cs @@ -235,7 +235,6 @@ public override int Run(InterpretedFrame frame) #region Initialize - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1012:AbstractTypesShouldNotHaveConstructors")] internal abstract class InitializeLocalInstruction : LocalAccessInstruction { internal InitializeLocalInstruction(int index) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NotEqualInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NotEqualInstruction.cs index cae1cb23b1cb8e..edc87ba12c88b8 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NotEqualInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NotEqualInstruction.cs @@ -490,7 +490,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type, bool liftedToNull) { if (liftedToNull) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NumericConvertInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NumericConvertInstruction.cs index 0a770f0880be48..fe4e1e9bdbe30f 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NumericConvertInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NumericConvertInstruction.cs @@ -52,7 +52,6 @@ public sealed override int Run(InterpretedFrame frame) public override string ToString() => InstructionName + "(" + _from + "->" + _to + ")"; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] internal sealed class Unchecked : NumericConvertInstruction { public override string InstructionName => "UncheckedConvert"; @@ -176,7 +175,6 @@ private object ConvertDouble(double obj) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible")] internal sealed class Checked : NumericConvertInstruction { public override string InstructionName => "CheckedConvert"; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/OrInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/OrInstruction.cs index a8b6cf0b78a5fb..aeab4a018e6525 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/OrInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/OrInstruction.cs @@ -174,7 +174,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type) { return type.GetNonNullableType().GetTypeCode() switch diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/RightShiftInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/RightShiftInstruction.cs index 5d8bac5d335553..6688ee12149758 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/RightShiftInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/RightShiftInstruction.cs @@ -160,7 +160,6 @@ public override int Run(InterpretedFrame frame) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static Instruction Create(Type type) { return type.GetNonNullableType().GetTypeCode() switch diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs index e0a23d48803433..afe5061a2f6b52 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs @@ -16,8 +16,6 @@ internal static partial class DelegateHelpers { private const int MaximumArity = 17; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] internal static Type MakeDelegate(Type[] types) { Debug.Assert(types != null && types.Length > 0); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LabelTarget.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LabelTarget.cs index 267f101b65cd44..1235fccc2559b6 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LabelTarget.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LabelTarget.cs @@ -27,7 +27,6 @@ internal LabelTarget(Type type, string? name) /// The type of value that is passed when jumping to the label /// (or System.Void if no value should be passed). /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] public Type Type { get; } /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/MemberExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/MemberExpression.cs index 7eb5785e80e407..eac4d4d7922a64 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/MemberExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/MemberExpression.cs @@ -125,7 +125,6 @@ public partial class Expression /// The containing object of the field. This can be null for static fields. /// The field to be accessed. /// The created . - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames")] public static MemberExpression Field(Expression? expression, FieldInfo field) { ContractUtils.RequiresNotNull(field, nameof(field)); @@ -175,7 +174,6 @@ public static MemberExpression Field(Expression expression, string fieldName) /// The containing the field. /// The field to be accessed. /// The created . - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames")] public static MemberExpression Field(Expression? expression, Type type, string fieldName) { ContractUtils.RequiresNotNull(type, nameof(type)); @@ -242,7 +240,6 @@ public static MemberExpression Property(Expression? expression, Type type, strin /// The containing object of the property. This can be null for static properties. /// The property to be accessed. /// The created . - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames")] public static MemberExpression Property(Expression? expression, PropertyInfo property) { ContractUtils.RequiresNotNull(property, nameof(property)); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/NewExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/NewExpression.cs index 9ea147e0d53c2c..5171d11086aef0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/NewExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/NewExpression.cs @@ -200,7 +200,6 @@ public static NewExpression New(Type type) return new NewValueTypeExpression(type, EmptyReadOnlyCollection.Instance, null); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] private static void ValidateNewArgs(ConstructorInfo constructor, ref ReadOnlyCollection arguments, ref ReadOnlyCollection members) { ParameterInfo[] pis; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs index 7433603fb76925..80df9f2127afe3 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/UnaryExpression.cs @@ -315,7 +315,6 @@ public static UnaryExpression MakeUnary(ExpressionType unaryType, Expression ope /// The that results from calling the appropriate factory method. /// Thrown when does not correspond to a unary expression. /// Thrown when is null. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] public static UnaryExpression MakeUnary(ExpressionType unaryType, Expression operand, Type type, MethodInfo? method) => unaryType switch { diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs index c90c5f5e839269..7c0116acbd2814 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSite.cs @@ -142,7 +142,6 @@ public T Update /// /// The Level 0 cache - a delegate specialized based on the site history. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")] public T Target = default!; /// @@ -172,7 +171,6 @@ private CallSite() { } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] internal CallSite CreateMatchMaker() { return new CallSite(); @@ -208,7 +206,6 @@ internal void ReleaseMatchmaker(CallSite matchMaker) /// /// The binder responsible for the runtime binding of the dynamic operations at this call site. /// The new instance of dynamic call site. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1000:DoNotDeclareStaticMembersOnGenericTypes")] public static CallSite Create(CallSiteBinder binder) { if (!typeof(T).IsSubclassOf(typeof(MulticastDelegate))) throw System.Linq.Expressions.Error.TypeMustBeDerivedFromSystemDelegate(); @@ -393,7 +390,6 @@ private static bool IsSimpleSignature(MethodInfo invoke, out Type[] sig) } #endif - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] private T CreateCustomUpdateDelegate(MethodInfo invoke) { Type returnType = invoke.GetReturnType(); @@ -686,7 +682,6 @@ private T CreateCustomUpdateDelegate(MethodInfo invoke) return lambda.Compile(); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] private T CreateCustomNoMatchDelegate(MethodInfo invoke) { ParameterExpression[] @params = Array.ConvertAll(invoke.GetParametersCached(), p => Expression.Parameter(p.ParameterType, p.Name)); diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSiteHelpers.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSiteHelpers.cs index 86449a9290245e..68d051d9e3ab61 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSiteHelpers.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSiteHelpers.cs @@ -23,7 +23,6 @@ public static class CallSiteHelpers /// True if the input is internally used by DLR and should not /// be displayed on the language code's stack. Otherwise, false. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] public static bool IsInternalFrame(MethodBase mb) { // All the dynamic methods created for DLR rules have a special name. diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/Closure.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/Closure.cs index 0432f5cb75b455..9bd006972b16d3 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/Closure.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/Closure.cs @@ -17,15 +17,11 @@ public sealed class Closure /// /// Represents the non-trivial constants and locally executable expressions that are referenced by a dynamically generated method. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")] public readonly object[] Constants; /// /// Represents the hoisted local variables from the parent context. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")] public readonly object[]? Locals; /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs index 5a588e92cef64e..645f961dedc007 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Runtime/CompilerServices/ReadOnlyCollectionBuilder.cs @@ -13,7 +13,6 @@ namespace System.Runtime.CompilerServices /// Builder for read only collections. /// /// The type of the collection element. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] public sealed class ReadOnlyCollectionBuilder : IList, IList { private const int DefaultCapacity = 4; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs index 16b3f05d9e735e..6bb0541910de4a 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpContentHeaders.cs @@ -8,8 +8,6 @@ namespace System.Net.Http.Headers { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "This is not a collection")] public sealed class HttpContentHeaders : HttpHeaders { private readonly HttpContent _parent; @@ -111,8 +109,6 @@ public Uri ContentLocation set { SetOrRemoveParsedValue(KnownHeaders.ContentLocation.Descriptor, value); } } - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", - Justification = "In this case the 'value' is the byte array. I.e. the array is treated as a value.")] public byte[] ContentMD5 { get { return (byte[])GetParsedValues(KnownHeaders.ContentMD5.Descriptor); } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs index 9ebd60870bef7a..686b0cb5158a27 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs @@ -29,8 +29,6 @@ namespace System.Net.Http.Headers // object. E.g. the client receives a response with the following header: 'Via: 1.1 proxy, invalid' // - HttpHeaders.GetValues() will return "1.1 proxy", "invalid" // - HttpResponseHeaders.Via collection will only contain one ViaHeaderValue object with value "1.1 proxy" - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "This is not a collection")] public abstract class HttpHeaders : IEnumerable>> { private Dictionary _headerStore; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpRequestHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpRequestHeaders.cs index cd564e88aa647b..47926dd2afeb75 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpRequestHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpRequestHeaders.cs @@ -7,8 +7,6 @@ namespace System.Net.Http.Headers { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "This is not a collection")] public sealed class HttpRequestHeaders : HttpHeaders { private const int AcceptSlot = 0; @@ -40,7 +38,6 @@ private T GetSpecializedCollection(int slot, Func crea public HttpHeaderValueCollection Accept => GetSpecializedCollection(AcceptSlot, thisRef => new HttpHeaderValueCollection(KnownHeaders.Accept.Descriptor, thisRef)); - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Charset", Justification = "The HTTP header name is 'Accept-Charset'.")] public HttpHeaderValueCollection AcceptCharset => GetSpecializedCollection(AcceptCharsetSlot, thisRef => new HttpHeaderValueCollection(KnownHeaders.AcceptCharset.Descriptor, thisRef)); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpResponseHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpResponseHeaders.cs index 4af2e89b360e78..c08b7456f3606a 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpResponseHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpResponseHeaders.cs @@ -7,8 +7,6 @@ namespace System.Net.Http.Headers { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "This is not a collection")] public sealed class HttpResponseHeaders : HttpHeaders { private const int AcceptRangesSlot = 0; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestException.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestException.cs index ea4efdae921f5a..68662c0f47aa01 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestException.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestException.cs @@ -7,7 +7,6 @@ namespace System.Net.Http { - [SuppressMessage("Microsoft.Serialization", "CA2229")] public class HttpRequestException : Exception { internal RequestRetryType AllowRetry { get; } = RequestRetryType.NoRetry; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs b/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs index 036214642e54de..ed2293a36f29fc 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs @@ -136,8 +136,6 @@ public HttpRequestMessage(HttpMethod method, Uri requestUri) if (NetEventSource.IsEnabled) NetEventSource.Exit(this); } - [SuppressMessage("Microsoft.Design", "CA1057:StringUriOverloadsCallSystemUriOverloads", - Justification = "It is OK to provide 'null' values. A Uri instance is created from 'requestUri' if it is != null.")] public HttpRequestMessage(HttpMethod method, string requestUri) { if (NetEventSource.IsEnabled) NetEventSource.Enter(this, method, requestUri); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs index 0f832a73f7c246..0930b59e3dc7f0 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartContent.cs @@ -13,9 +13,6 @@ namespace System.Net.Http { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "Represents a multipart/* content. Even if a collection of HttpContent is stored, " + - "suffix Collection is not appropriate.")] public class MultipartContent : HttpContent, IEnumerable { #region Fields diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs index 6158bb98de86fc..dd88505e96c155 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/MultipartFormDataContent.cs @@ -10,9 +10,6 @@ namespace System.Net.Http { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", - Justification = "Represents a multipart/form-data content. Even if a collection of HttpContent is stored, " + - "suffix Collection is not appropriate.")] public class MultipartFormDataContent : MultipartContent { private const string formData = "form-data"; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientException.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientException.cs index 2bb95d9ecbaa26..bad12eab6a22db 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientException.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientException.cs @@ -49,7 +49,6 @@ public string FailedRecipient } } - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "System.dll is still using pre-v4 security model and needs this demand")] void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { GetObjectData(serializationInfo, streamingContext); diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientsException.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientsException.cs index 96d7cda2fbcdc4..e6a3b3858fb384 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientsException.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpFailedRecipientsException.cs @@ -68,7 +68,6 @@ public SmtpFailedRecipientException[] InnerExceptions } } - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "System.dll is still using pre-v4 security model and needs this demand")] void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { GetObjectData(serializationInfo, streamingContext); diff --git a/src/libraries/System.Net.Requests/src/FxCopBaseline.cs b/src/libraries/System.Net.Requests/src/FxCopBaseline.cs deleted file mode 100644 index 555bfdee18ba52..00000000000000 --- a/src/libraries/System.Net.Requests/src/FxCopBaseline.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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 - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("Microsoft.Design", "CA2237", Scope = "type", Target = "System.Net.FtpWebRequest")] -[assembly: SuppressMessage("Microsoft.Design", "CA2237", Scope = "type", Target = "System.Net.FtpWebResponse")] - -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.FileWebRequest.#CheckAndMarkAsyncGetRequestStreamPending()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.FileWebRequest.#CheckAndMarkAsyncGetResponsePending()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.FileWebRequest.#CreateResponse():System.Net.WebResponse")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.FileWebRequest.#UnblockReader()")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.CommandStream.#Abort(System.Exception)")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.CommandStream.#ContinueCommandPipeline():System.IO.Stream")] -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Net.FtpWebResponse.#get_Headers():System.Net.WebHeaderCollection")] diff --git a/src/libraries/System.Net.Requests/src/System.Net.Requests.csproj b/src/libraries/System.Net.Requests/src/System.Net.Requests.csproj index d63ccd8c030894..fe4a6b1d1399e2 100644 --- a/src/libraries/System.Net.Requests/src/System.Net.Requests.csproj +++ b/src/libraries/System.Net.Requests/src/System.Net.Requests.csproj @@ -5,9 +5,6 @@ true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix - - - diff --git a/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs b/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs index 64666bc5f6337f..40c048620e9792 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs @@ -58,7 +58,6 @@ protected override void Dispose(bool disposing) } //TODO: Add this to FxCopBaseline.cs once https://github.com/dotnet/roslyn/issues/15728 is fixed - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity")] void ICloseEx.CloseEx(CloseExState closeState) { if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"state = {closeState}"); diff --git a/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs b/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs index 115ee1ec78b54c..a5df90b0778efc 100644 --- a/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs +++ b/src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketOptions.cs @@ -85,8 +85,6 @@ public IWebProxy Proxy } } - [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", - Justification = "This collection will be handed off directly to HttpWebRequest.")] public X509CertificateCollection ClientCertificates { get diff --git a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketCloseStatus.cs b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketCloseStatus.cs index 1e380c683bf53c..40511e11140cbb 100644 --- a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketCloseStatus.cs +++ b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketCloseStatus.cs @@ -6,10 +6,6 @@ namespace System.Net.WebSockets { - [SuppressMessage("Microsoft.Design", - "CA1008:EnumsShouldHaveZeroValue", - Justification = "This enum is reflecting the IETF's WebSocket specification. " + - "'0' is a disallowed value for the close status code")] public enum WebSocketCloseStatus { NormalClosure = 1000, diff --git a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketException.cs b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketException.cs index 7fe52650b8b7d3..5b18816ae71446 100644 --- a/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketException.cs +++ b/src/libraries/System.Net.WebSockets/src/System/Net/WebSockets/WebSocketException.cs @@ -15,44 +15,32 @@ public sealed class WebSocketException : Win32Exception { private readonly WebSocketError _webSocketErrorCode; - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException() : this(Marshal.GetLastWin32Error()) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error) : this(error, GetErrorMessage(error)) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, string? message) : base(message) { _webSocketErrorCode = error; } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, Exception? innerException) : this(error, GetErrorMessage(error), innerException) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, string? message, Exception? innerException) : base(message, innerException) { _webSocketErrorCode = error; } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(int nativeError) : base(nativeError) { @@ -60,8 +48,6 @@ public WebSocketException(int nativeError) SetErrorCodeOnError(nativeError); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(int nativeError, string? message) : base(nativeError, message) { @@ -69,8 +55,6 @@ public WebSocketException(int nativeError, string? message) SetErrorCodeOnError(nativeError); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(int nativeError, Exception? innerException) : base(SR.net_WebSockets_Generic, innerException) { @@ -78,15 +62,11 @@ public WebSocketException(int nativeError, Exception? innerException) SetErrorCodeOnError(nativeError); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, int nativeError) : this(error, nativeError, GetErrorMessage(error)) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, int nativeError, string? message) : base(message) { @@ -94,15 +74,11 @@ public WebSocketException(WebSocketError error, int nativeError, string? message SetErrorCodeOnError(nativeError); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, int nativeError, Exception? innerException) : this(error, nativeError, GetErrorMessage(error), innerException) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(WebSocketError error, int nativeError, string? message, Exception? innerException) : base(message, innerException) { @@ -110,15 +86,11 @@ public WebSocketException(WebSocketError error, int nativeError, string? message SetErrorCodeOnError(nativeError); } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(string? message) : base(message) { } - [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", - Justification = "This ctor is harmless, because it does not pass arbitrary data into the native code.")] public WebSocketException(string? message, Exception? innerException) : base(message, innerException) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs index 14755e591592ed..fe1021272a282e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.cs @@ -768,7 +768,6 @@ internal abstract class QueueUserWorkItemCallbackBase : IThreadPoolWorkItem #if DEBUG private int executed; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1821:RemoveEmptyFinalizers")] ~QueueUserWorkItemCallbackBase() { Interlocked.MemoryBarrier(); // ensure that an old cached value is not read below diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs index 5b2c29b0151a1f..f19cd3712678dd 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs @@ -471,8 +471,6 @@ public override void WriteComment(string text) throw new NotSupportedException(SR.Format(SR.JsonMethodNotSupported, "WriteComment")); } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "2#sysid", Justification = "This method is derived from the base")] - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "1#pubid", Justification = "This method is derived from the base")] public override void WriteDocType(string name, string pubid, string sysid, string subset) { throw new NotSupportedException(SR.Format(SR.JsonMethodNotSupported, "WriteDocType")); @@ -773,7 +771,6 @@ public override void WriteRaw(char[] buffer, int index, int count) WriteString(new string(buffer, index, count)); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // Microsoft, ToLowerInvariant is just used in Json error message public override void WriteStartAttribute(string prefix, string localName, string ns) { if (IsClosed) @@ -1136,7 +1133,6 @@ public override void WriteValue(object value) } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Whitespace", Justification = "This method is derived from the base")] public override void WriteWhitespace(string ws) { if (IsClosed) @@ -1327,7 +1323,6 @@ private void ThrowIfServerTypeWritten(string dataTypeSpecified) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")] // Microsoft, ToLowerInvariant is just used in Json error message private void ThrowInvalidAttributeContent() { if (HasOpenAttribute) diff --git a/src/libraries/System.Private.Uri/src/FxCopBaseline.cs b/src/libraries/System.Private.Uri/src/FxCopBaseline.cs deleted file mode 100644 index dc2623db1e8a54..00000000000000 --- a/src/libraries/System.Private.Uri/src/FxCopBaseline.cs +++ /dev/null @@ -1,8 +0,0 @@ -// 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. - -using System.Diagnostics.CodeAnalysis; - -// TODO: Remove this once https://github.com/dotnet/corefx/issues/13107 is fixed -[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Uri.#CreateUriInfo(System.Uri+Flags)")] diff --git a/src/libraries/System.Private.Uri/src/System.Private.Uri.csproj b/src/libraries/System.Private.Uri/src/System.Private.Uri.csproj index 32f03ad6fd1369..d2113746010c2a 100644 --- a/src/libraries/System.Private.Uri/src/System.Private.Uri.csproj +++ b/src/libraries/System.Private.Uri/src/System.Private.Uri.csproj @@ -10,9 +10,6 @@ Common\System\Collections\Generic\ArrayBuilder.cs - - - diff --git a/src/libraries/System.Private.Uri/src/System/Uri.cs b/src/libraries/System.Private.Uri/src/System/Uri.cs index 91f2ec1ed33f3c..808cf4f6c4ba76 100644 --- a/src/libraries/System.Private.Uri/src/System/Uri.cs +++ b/src/libraries/System.Private.Uri/src/System/Uri.cs @@ -402,7 +402,6 @@ protected Uri(SerializationInfo serializationInfo, StreamingContext streamingCon // ISerializable method // /// - [SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase", Justification = "System.dll is still using pre-v4 security model and needs this demand")] void ISerializable.GetObjectData(SerializationInfo serializationInfo, StreamingContext streamingContext) { GetObjectData(serializationInfo, streamingContext); diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XAttribute.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XAttribute.cs index 9adafce0b9c60e..ec52cd26cd905e 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XAttribute.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XAttribute.cs @@ -16,7 +16,6 @@ namespace System.Xml.Linq /// /// An XML attribute is a name/value pair associated with an XML element. /// - [SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix", Justification = "Reviewed.")] [System.ComponentModel.TypeDescriptionProvider("MS.Internal.Xml.Linq.ComponentModel.XTypeDescriptionProvider`1[[System.Xml.Linq.XAttribute, System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]],System.ComponentModel.TypeConverter")] public class XAttribute : XObject { diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XDocument.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XDocument.cs index 85959975350e44..b3b9cf563e3129 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XDocument.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XDocument.cs @@ -184,7 +184,6 @@ public XElement Root /// An initialized with the contents of the file referenced /// in the passed in uri parameter. /// - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#", Justification = "Back-compat with System.Xml.")] public static XDocument Load(string uri) { return Load(uri, LoadOptions.None); @@ -213,7 +212,6 @@ public static XDocument Load(string uri) /// in the passed uri parameter. If LoadOptions.PreserveWhitespace is enabled then /// all whitespace will be preserved. /// - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#", Justification = "Back-compat with System.Xml.")] public static XDocument Load(string uri, LoadOptions options) { XmlReaderSettings rs = GetXmlReaderSettings(options); diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs index 5ccbf7e98a373d..9d9445bcdbdb62 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XElement.cs @@ -568,7 +568,6 @@ public string GetPrefixOfNamespace(XNamespace ns) /// An initialized with the contents of the file referenced /// in the passed in uri parameter. /// - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", Justification = "Back-compat with System.Xml.")] public static XElement Load(string uri) { return Load(uri, LoadOptions.None); @@ -598,7 +597,6 @@ public static XElement Load(string uri) /// in the passed uri parameter. If LoadOptions.PreserveWhitespace is enabled then /// significant whitespace will be preserved. /// - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", Justification = "Back-compat with System.Xml.")] public static XElement Load(string uri, LoadOptions options) { XmlReaderSettings rs = GetXmlReaderSettings(options); @@ -1331,7 +1329,6 @@ public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellati /// The content of this as a . /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator string(XElement element) { if (element == null) return null; @@ -1354,7 +1351,6 @@ public static explicit operator string(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator bool(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1374,7 +1370,6 @@ public static explicit operator bool(XElement element) /// Thrown if the element does not contain a valid boolean value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator bool?(XElement element) { if (element == null) return null; @@ -1397,7 +1392,6 @@ public static explicit operator bool(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator int(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1417,7 +1411,6 @@ public static explicit operator int(XElement element) /// Thrown if the specified element does not contain a valid integer value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator int?(XElement element) { if (element == null) return null; @@ -1440,7 +1433,6 @@ public static explicit operator int(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator uint(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1460,7 +1452,6 @@ public static explicit operator uint(XElement element) /// Thrown if the specified element does not contain a valid unsigned integer value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator uint?(XElement element) { if (element == null) return null; @@ -1483,7 +1474,6 @@ public static explicit operator uint(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator long(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1503,7 +1493,6 @@ public static explicit operator long(XElement element) /// Thrown if the specified element does not contain a valid long integer value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator long?(XElement element) { if (element == null) return null; @@ -1526,7 +1515,6 @@ public static explicit operator long(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator ulong(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1546,7 +1534,6 @@ public static explicit operator ulong(XElement element) /// Thrown if the specified element does not contain a valid unsigned long integer value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator ulong?(XElement element) { if (element == null) return null; @@ -1569,7 +1556,6 @@ public static explicit operator ulong(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator float(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1589,7 +1575,6 @@ public static explicit operator float(XElement element) /// Thrown if the specified element does not contain a valid float value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator float?(XElement element) { if (element == null) return null; @@ -1612,7 +1597,6 @@ public static explicit operator float(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator double(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1632,7 +1616,6 @@ public static explicit operator double(XElement element) /// Thrown if the specified element does not contain a valid double value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator double?(XElement element) { if (element == null) return null; @@ -1655,7 +1638,6 @@ public static explicit operator double(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator decimal(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1675,7 +1657,6 @@ public static explicit operator decimal(XElement element) /// Thrown if the specified element does not contain a valid decimal value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator decimal?(XElement element) { if (element == null) return null; @@ -1698,7 +1679,6 @@ public static explicit operator decimal(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator DateTime(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1718,7 +1698,6 @@ public static explicit operator DateTime(XElement element) /// Thrown if the specified element does not contain a valid value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator DateTime?(XElement element) { if (element == null) return null; @@ -1741,7 +1720,6 @@ public static explicit operator DateTime(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator DateTimeOffset(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1761,7 +1739,6 @@ public static explicit operator DateTimeOffset(XElement element) /// Thrown if the specified element does not contain a valid value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator DateTimeOffset?(XElement element) { if (element == null) return null; @@ -1784,7 +1761,6 @@ public static explicit operator DateTimeOffset(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator TimeSpan(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1804,7 +1780,6 @@ public static explicit operator TimeSpan(XElement element) /// Thrown if the specified element does not contain a valid value. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator TimeSpan?(XElement element) { if (element == null) return null; @@ -1827,7 +1802,6 @@ public static explicit operator TimeSpan(XElement element) /// Thrown if the specified element is null. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator Guid(XElement element) { if (element == null) throw new ArgumentNullException(nameof(element)); @@ -1847,7 +1821,6 @@ public static explicit operator Guid(XElement element) /// Thrown if the specified element does not contain a valid guid. /// [CLSCompliant(false)] - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Operator marked with CLSCompliant(false).")] public static explicit operator Guid?(XElement element) { if (element == null) return null; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XLinq.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XLinq.cs index 46f70689f547f4..e2a4a4f782261f 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XLinq.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XLinq.cs @@ -690,7 +690,6 @@ public enum LoadOptions None = 0x00000000, /// Preserve whitespace. - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", Justification = "Back-compat with System.Xml.")] PreserveWhitespace = 0x00000001, /// Set the BaseUri property. diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XName.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XName.cs index e9d9972d66c711..562916d00ceca7 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XName.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XName.cs @@ -10,7 +10,6 @@ namespace System.Xml.Linq /// /// Represents a name of an XML element or attribute. This class cannot be inherited. /// - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Serialization", "CA2229", Justification = "Serialized with custom proxy")] public sealed class XName : IEquatable, ISerializable { private readonly XNamespace _ns; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNamespace.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNamespace.cs index aa145058f97de4..2f6ec4934aa039 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNamespace.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNamespace.cs @@ -135,7 +135,6 @@ public static implicit operator XNamespace(string namespaceName) /// The namespace for the expanded name. /// The local name for the expanded name. /// The new XName constructed from the namespace and local name. - [SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Functionality available via XNamespace.Get().")] public static XName operator +(XNamespace ns, string localName) { if (ns == null) throw new ArgumentNullException(nameof(ns)); diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNode.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNode.cs index ac8e213e780870..9a54bdc7dfd1f1 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNode.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNode.cs @@ -235,7 +235,6 @@ public IEnumerable Ancestors(XName name) /// /// Thrown if the two nodes do not share a common ancestor. /// - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Reviewed.")] public static int CompareDocumentOrder(XNode n1, XNode n2) { if (n1 == n2) return 0; @@ -613,7 +612,6 @@ public string ToString(SaveOptions options) /// Two nodes are equal if they have the same /// target and data. Two nodes are equal if the have the /// same name, public id, system id, and internal subset. - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Justification = "Reviewed.")] public static bool DeepEquals(XNode n1, XNode n2) { if (n1 == n2) return true; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObject.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObject.cs index 0e8e7d38c2e5a2..15dd754c059497 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObject.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObject.cs @@ -22,7 +22,6 @@ internal XObject() { } /// /// Get the BaseUri for this . /// - [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "Back-compat with System.Xml.")] public string BaseUri { get diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeEventArgs.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeEventArgs.cs index cd68bba006fb48..bdd9d4e26d2f83 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeEventArgs.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeEventArgs.cs @@ -16,25 +16,21 @@ public class XObjectChangeEventArgs : EventArgs /// /// Event argument for a change event. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "XObjectChangeEventArgs is in fact immutable.")] public static readonly XObjectChangeEventArgs Add = new XObjectChangeEventArgs(XObjectChange.Add); /// /// Event argument for a change event. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "XObjectChangeEventArgs is in fact immutable.")] public static readonly XObjectChangeEventArgs Remove = new XObjectChangeEventArgs(XObjectChange.Remove); /// /// Event argument for a change event. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "XObjectChangeEventArgs is in fact immutable.")] public static readonly XObjectChangeEventArgs Name = new XObjectChangeEventArgs(XObjectChange.Name); /// /// Event argument for a change event. /// - [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "XObjectChangeEventArgs is in fact immutable.")] public static readonly XObjectChangeEventArgs Value = new XObjectChangeEventArgs(XObjectChange.Value); /// diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs index 6b39b8ab64545c..a4ded030af4eab 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs @@ -433,7 +433,6 @@ public static class Extensions /// Gets the schema information that has been assigned to the as a result of schema validation. /// /// Extension point - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Reviewed by the design group.")] public static IXmlSchemaInfo GetSchemaInfo(this XElement source) { if (source == null) throw new ArgumentNullException(nameof(source)); @@ -444,7 +443,6 @@ public static IXmlSchemaInfo GetSchemaInfo(this XElement source) /// Gets the schema information that has been assigned to the as a result of schema validation. /// /// Extension point - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Reviewed by the design group.")] public static IXmlSchemaInfo GetSchemaInfo(this XAttribute source) { if (source == null) throw new ArgumentNullException(nameof(source)); @@ -475,7 +473,6 @@ public static void Validate(this XDocument source, XmlSchemaSet schemas, Validat /// If enabled the and the corresponding /// subtree is augmented with PSVI in the form of annotations, /// default attributes and default element values - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Reviewed by the design group.")] public static void Validate(this XDocument source, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { if (source == null) throw new ArgumentNullException(nameof(source)); @@ -513,7 +510,6 @@ public static void Validate(this XElement source, XmlSchemaObject partialValidat /// If enabled the and the corresponding /// subtree is augmented with PSVI in the form of annotations, /// default attributes and default element values - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Reviewed by the design group.")] public static void Validate(this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { if (source == null) throw new ArgumentNullException(nameof(source)); @@ -552,7 +548,6 @@ public static void Validate(this XAttribute source, XmlSchemaObject partialValid /// If enabled the is augmented with PSVI /// in the form of annotations, default attributes and /// default element values - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters", Justification = "Reviewed by the design group.")] public static void Validate(this XAttribute source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) { if (source == null) throw new ArgumentNullException(nameof(source)); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs index 696e43e3c7558c..689085049634c4 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs @@ -423,7 +423,6 @@ internal static bool GenerateSerializerToStream(XmlMapping[] xmlMappings, Type[] } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "It is safe because the serialization assembly is generated by the framework code, not by the user.")] internal static Assembly GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace) { var scopeTable = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Xmlcustomformatter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Xmlcustomformatter.cs index bea1ab00dcc9f0..f9d6bdd15d88c7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Xmlcustomformatter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Xmlcustomformatter.cs @@ -24,7 +24,6 @@ internal class XmlCustomFormatter private static DateTimeSerializationSection.DateTimeSerializationMode Mode { - [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread-safety")] get { if (s_mode == DateTimeSerializationSection.DateTimeSerializationMode.Default) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs index d378f11d72b76c..c67af0d72dcb4d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs @@ -355,7 +355,6 @@ public void Transform(XmlReader input, XsltArgumentList arguments, Stream result // suppress the message. //------------------------------------------------ - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] public void Transform(string inputUri, XmlWriter results) { CheckArguments(inputUri, results); @@ -365,7 +364,6 @@ public void Transform(string inputUri, XmlWriter results) } } - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] public void Transform(string inputUri, XsltArgumentList arguments, XmlWriter results) { CheckArguments(inputUri, results); @@ -375,7 +373,6 @@ public void Transform(string inputUri, XsltArgumentList arguments, XmlWriter res } } - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] public void Transform(string inputUri, XsltArgumentList arguments, TextWriter results) { CheckArguments(inputUri, results); @@ -387,7 +384,6 @@ public void Transform(string inputUri, XsltArgumentList arguments, TextWriter re } } - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] public void Transform(string inputUri, XsltArgumentList arguments, Stream results) { CheckArguments(inputUri, results); @@ -399,7 +395,6 @@ public void Transform(string inputUri, XsltArgumentList arguments, Stream result } } - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] public void Transform(string inputUri, string resultsFile) { if (inputUri == null) diff --git a/src/libraries/System.Reflection.Context/tests/Properties/Resources.Designer.cs b/src/libraries/System.Reflection.Context/tests/Properties/Resources.Designer.cs index 8f6d6725097bc3..cadfcf9e79ecb6 100644 --- a/src/libraries/System.Reflection.Context/tests/Properties/Resources.Designer.cs +++ b/src/libraries/System.Reflection.Context/tests/Properties/Resources.Designer.cs @@ -29,7 +29,6 @@ internal class Resources { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } diff --git a/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.Designer.cs b/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.Designer.cs index ef89f49c74e9a1..ea4cfbf9e6f4a0 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.Designer.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.Designer.cs @@ -29,7 +29,6 @@ internal class TestResx { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TestResx() { } diff --git a/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.netstandard17.Designer.cs b/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.netstandard17.Designer.cs index 8cef5ec573140e..5cce2628673cd8 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.netstandard17.Designer.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/Resources/TestResx.netstandard17.Designer.cs @@ -28,7 +28,6 @@ internal class TestResx_netstandard17 { private static global::System.Globalization.CultureInfo resourceCulture; - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal TestResx_netstandard17() { } diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs index 0fa963043f5df6..902862da7af532 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs @@ -83,7 +83,6 @@ internal bool IsInvalid } } - [SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", Justification = "Grandfathered suppression from original caching code checkin")] [StructLayout(LayoutKind.Explicit)] internal struct ExpiresEntry { @@ -619,7 +618,6 @@ internal void RemoveCacheEntry(MemoryCacheEntry cacheEntry) } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal void UtcUpdateCacheEntry(MemoryCacheEntry cacheEntry, DateTime utcExpires) { lock (this) @@ -953,7 +951,6 @@ internal void Remove(MemoryCacheEntry cacheEntry) } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal void UtcUpdate(MemoryCacheEntry cacheEntry, DateTime utcNewExpires) { int oldBucket = cacheEntry.ExpiresBucket; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs index a4abc08b874daa..632d9f96f9a4d6 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs @@ -116,7 +116,6 @@ internal struct UsageEntryLink internal UsageEntryRef _prev; } - [SuppressMessage("Microsoft.Portability", "CA1900:ValueTypeFieldsShouldBePortable", Justification = "Grandfathered suppression from original caching code checkin")] [StructLayout(LayoutKind.Explicit)] internal struct UsageEntry { @@ -901,7 +900,6 @@ internal void Remove(MemoryCacheEntry cacheEntry) } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal void Update(MemoryCacheEntry cacheEntry) { byte bucket = cacheEntry.UsageBucket; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ChangeMonitor.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ChangeMonitor.cs index 0c567646f74801..822eba08cbf5b2 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ChangeMonitor.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ChangeMonitor.cs @@ -92,7 +92,6 @@ public abstract class ChangeMonitor : IDisposable // The helper routines (OnChangedHelper and DisposeHelper) are used to prevent // an infinite loop, where Dispose calls OnChanged and OnChanged calls Dispose. - [SuppressMessage("Microsoft.Performance", "CA1816:DisposeMethodsShouldCallSuppressFinalize", Justification = "Grandfathered suppression from original caching code checkin")] private void DisposeHelper() { // if not initialized, return without doing anything. @@ -202,7 +201,6 @@ protected void OnChanged(object state) // Dispose() will only invoke the Dispose(bool disposing) method of derived classes // once, the first time it is called. Subsequent calls to Dispose() perform no // operation. After Dispose is called, the IsDisposed property will be true. - [SuppressMessage("Microsoft.Performance", "CA1816:DisposeMethodsShouldCallSuppressFinalize", Justification = "Grandfathered suppression from original caching code checkin")] public void Dispose() { OnChangedHelper(null); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs index 3755965dcbfc1c..3dcbf43fecb9c1 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCache.cs @@ -17,7 +17,6 @@ namespace System.Runtime.Caching { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "The class represents a type of cache")] public class MemoryCache : ObjectCache, IEnumerable, IDisposable { private const DefaultCacheCapabilities CAPABILITIES = DefaultCacheCapabilities.InMemoryProvider @@ -868,7 +867,6 @@ public override IDictionary GetValues(IEnumerable keys, // used when redirecting ASP.NET cache into the MemoryCache. This avoids infinite recursion // due to the fact that the (ASP.NET) config system uses the cache, and the cache uses the // config system. - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal void UpdateConfig(NameValueCollection config) { if (config == null) diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs index 5f87a4d861e250..4047cc69c045b2 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs @@ -98,7 +98,6 @@ internal UsageEntryRef UsageEntryRef set { _usageEntryRef = value; } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal DateTime UtcLastUpdateUsage { get { return _utcLastUpdateUsage; } diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs index 16d7fc8fdf7792..b16fce3598c073 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheStatistics.cs @@ -333,7 +333,6 @@ public void Dispose() } } - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Grandfathered suppression from original caching code checkin")] internal void UpdateConfig(NameValueCollection config) { int pollingInterval = ConfigUtil.GetIntValueFromTimeSpan(config, ConfigUtil.PollingInterval, _configPollingInterval); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ObjectCache.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ObjectCache.cs index 793ee6545094ab..834a1eb7d5ac8b 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ObjectCache.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/ObjectCache.cs @@ -14,7 +14,6 @@ namespace System.Runtime.Caching { - [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Justification = "The class represents a type of cache")] public abstract class ObjectCache : IEnumerable> { private static IServiceProvider s_host; @@ -87,18 +86,14 @@ public virtual bool Add(string key, object value, CacheItemPolicy policy, string public abstract object AddOrGetExisting(string key, object value, CacheItemPolicy policy, string regionName = null); - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "The name best represents an operation on a cache")] public abstract object Get(string key, string regionName = null); public abstract CacheItem GetCacheItem(string key, string regionName = null); - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "The name best represents an operation on a cache")] public abstract void Set(string key, object value, DateTimeOffset absoluteExpiration, string regionName = null); - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "The name best represents an operation on a cache")] public abstract void Set(CacheItem item, CacheItemPolicy policy); - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "The name best represents an operation on a cache")] public abstract void Set(string key, object value, CacheItemPolicy policy, string regionName = null); //Get multiple items by keys diff --git a/src/libraries/System.Runtime.Extensions/src/System/Net/WebUtility.cs b/src/libraries/System.Runtime.Extensions/src/System/Net/WebUtility.cs index d09b4ff4207a03..e2d1e1831117ca 100644 --- a/src/libraries/System.Runtime.Extensions/src/System/Net/WebUtility.cs +++ b/src/libraries/System.Runtime.Extensions/src/System/Net/WebUtility.cs @@ -404,7 +404,6 @@ private static void GetEncodedBytes(byte[] originalBytes, int offset, int count, #region UrlEncode public methods - [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", Justification = "Already shipped public API; code moved here as part of API consolidation")] [return: NotNullIfNotNull("value")] public static string? UrlEncode(string? value) { @@ -608,7 +607,6 @@ private static void GetEncodedBytes(byte[] originalBytes, int offset, int count, #region UrlDecode public methods - [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", Justification = "Already shipped public API; code moved here as part of API consolidation")] [return: NotNullIfNotNull("encodedValue")] public static string? UrlDecode(string? encodedValue) { diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs index e5e0d631628543..aecfdb9066bc31 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/Complex.cs @@ -424,7 +424,6 @@ public static Complex Sin(Complex value) // instead produces (PositiveInfinity, PositiveInfinity). } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sinh", Justification = "Sinh is the name of a mathematical function.")] public static Complex Sinh(Complex value) { // Use sinh(z) = -i sin(iz) to compute via sin(z). @@ -462,7 +461,6 @@ public static Complex Cos(Complex value) return new Complex(Math.Cos(value.m_real) * cosh, -Math.Sin(value.m_real) * sinh); } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Cosh", Justification = "Cosh is the name of a mathematical function.")] public static Complex Cosh(Complex value) { // Use cosh(z) = cos(iz) to compute via cos(z). @@ -519,7 +517,6 @@ public static Complex Tan(Complex value) } } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Tanh", Justification = "Tanh is the name of a mathematical function.")] public static Complex Tanh(Complex value) { // Use tanh(z) = -i tan(iz) to compute via tan(z). @@ -681,7 +678,6 @@ public static Complex Exp(Complex value) return new Complex(cosImaginary, sinImaginary); } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Sqrt", Justification = "Sqrt is the name of a mathematical function.")] public static Complex Sqrt(Complex value) { diff --git a/src/libraries/System.Runtime/src/System/Action.cs b/src/libraries/System.Runtime/src/System/Action.cs index c7b178784bc01a..84f60a01402e41 100644 --- a/src/libraries/System.Runtime/src/System/Action.cs +++ b/src/libraries/System.Runtime/src/System/Action.cs @@ -4,27 +4,19 @@ namespace System { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate void Action(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16); } diff --git a/src/libraries/System.Runtime/src/System/Function.cs b/src/libraries/System.Runtime/src/System/Function.cs index 224d16dda537ea..43f647ee92300d 100644 --- a/src/libraries/System.Runtime/src/System/Function.cs +++ b/src/libraries/System.Runtime/src/System/Function.cs @@ -4,27 +4,19 @@ namespace System { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public delegate TResult Func(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16); } diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs index acefe67abe10d3..828384a99d096e 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/AppleCertificatePal.cs @@ -345,8 +345,7 @@ public DateTime NotBefore } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", - Justification = "SHA1 is required for Compat")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "SHA1 is required for Compat")] public byte[] Thumbprint { get diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate.cs index fede91c13a3976..c5f70eb9f35a10 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate.cs @@ -163,7 +163,6 @@ public X509Certificate(X509Certificate cert) } } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Public API has already shipped.")] public X509Certificate(SerializationInfo info, StreamingContext context) : this() { throw new PlatformNotSupportedException(); diff --git a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs index 42e5617ad78cc6..be5c623b29967e 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs +++ b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs @@ -300,7 +300,6 @@ private void CreateFromToken(IntPtr userToken) _safeTokenHandle = DuplicateAccessToken(userToken); } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Public API has already shipped.")] public WindowsIdentity(SerializationInfo info, StreamingContext context) { throw new PlatformNotSupportedException(); diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10FeedFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10FeedFormatter.cs index 9cc2777c14ea75..9e5feb9a12e173 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10FeedFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10FeedFormatter.cs @@ -81,10 +81,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(Atom10Constants.FeedTag, Atom10Constants.Atom10Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -95,7 +93,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadFeed(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) @@ -513,7 +510,6 @@ protected virtual SyndicationItem ReadItem(XmlReader reader, SyndicationFeed fee return item; } - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "The out parameter is needed to enable implementations that read in items from the stream on demand")] protected virtual IEnumerable ReadItems(XmlReader reader, SyndicationFeed feed, out bool areAllItemsRead) { if (feed == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10ItemFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10ItemFormatter.cs index 63417f0bdff291..5a735ac89c1852 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10ItemFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Atom10ItemFormatter.cs @@ -73,10 +73,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(Atom10Constants.EntryTag, Atom10Constants.Atom10Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -87,7 +85,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadItem(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatter.cs index 152d9a0505bfbe..7d4cffd334eb7f 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatter.cs @@ -71,10 +71,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(App10Constants.Categories, App10Constants.Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -85,7 +83,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadDocument(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatter.cs index b3bb4e5c84eb6b..b08193ea2ddc64 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatter.cs @@ -56,10 +56,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(App10Constants.Service, App10Constants.Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -70,7 +68,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadDocument(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs index c27166b87887c8..3ff0f52f33dd75 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20FeedFormatter.cs @@ -83,10 +83,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(Rss20Constants.RssTag, Rss20Constants.Rss20Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -97,7 +95,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadFeed(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) @@ -164,7 +161,6 @@ protected virtual SyndicationItem ReadItem(XmlReader reader, SyndicationFeed fee return item; } - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Justification = "The out parameter is needed to enable implementations that read in items from the stream on demand")] protected virtual IEnumerable ReadItems(XmlReader reader, SyndicationFeed feed, out bool areAllItemsRead) { if (feed == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20ItemFormatter.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20ItemFormatter.cs index 740867104cf705..2f2a76b6212256 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20ItemFormatter.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/Rss20ItemFormatter.cs @@ -96,10 +96,8 @@ public override bool CanRead(XmlReader reader) return reader.IsStartElement(Rss20Constants.ItemTag, Rss20Constants.Rss20Namespace); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] XmlSchema IXmlSerializable.GetSchema() => null; - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.ReadXml(XmlReader reader) { if (reader == null) @@ -110,7 +108,6 @@ void IXmlSerializable.ReadXml(XmlReader reader) ReadItem(reader); } - [SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Justification = "The IXmlSerializable implementation is only for exposing under WCF DataContractSerializer. The funcionality is exposed to derived class through the ReadFrom\\WriteTo methods")] void IXmlSerializable.WriteXml(XmlWriter writer) { if (writer == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationItem.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationItem.cs index e86068331dcdca..d1f8a1da835872 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationItem.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationItem.cs @@ -180,8 +180,6 @@ public DateTimeOffset PublishDate } - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "0#permalink", Justification = "permalink is a term defined in the RSS format")] - [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Permalink", Justification = "permalink is a term defined in the RSS format")] public void AddPermalink(Uri permalink) { if (permalink == null) diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationPerson.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationPerson.cs index 53b37f18e15bd0..49b5f3495b99a9 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationPerson.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/SyndicationPerson.cs @@ -21,7 +21,6 @@ public SyndicationPerson(string email) : this(email, null, null) { } - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "2#", Justification = "The Uri represents a unique category and not a network location")] public SyndicationPerson(string email, string name, string uri) { Name = name; @@ -50,7 +49,6 @@ protected SyndicationPerson(SyndicationPerson source) public string Name { get; set; } - [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Scope = "property", Justification = "The Uri represents a unique category and not a network location")] public string Uri { get; set; } public virtual SyndicationPerson Clone() => new SyndicationPerson(this); diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Base/DataflowBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Base/DataflowBlock.cs index c41568db8f0d7d..73dd608d85cf70 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Base/DataflowBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Base/DataflowBlock.cs @@ -190,7 +190,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeader, ITa IDisposable ISourceBlock.LinkTo(ITargetBlock target, DataflowLinkOptions linkOptions) { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -291,7 +290,6 @@ public static Task SendAsync(this ITargetBlock target, TIn /// /// /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] public static Task SendAsync(this ITargetBlock target, TInput item, CancellationToken cancellationToken) { // Validate arguments. No validation necessary for item. @@ -495,7 +493,6 @@ private void CompleteAsCanceled(bool runAsync) /// the target is calling to ConsumeMessage. We don't want to block the target indefinitely /// with any synchronous continuations off of the returned send async task. /// - [SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly")] private void RunCompletionAction(Action completionAction, object completionActionState, bool runAsync) { Debug.Assert(completionAction != null, "Completion action to run is required."); @@ -563,7 +560,6 @@ private static void CancellationHandler(object state) } /// Offers the message to the target synchronously. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal void OfferToTarget() { try @@ -724,7 +720,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeade void IDataflowBlock.Fault(Exception exception) { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -934,7 +929,6 @@ public static TOutput Receive( /// /// If the source successfully offered an item that was received by this operation, it will be returned, even if a concurrent timeout or cancellation request occurs. /// - [SuppressMessage("Microsoft.Usage", "CA2200:RethrowToPreserveStackDetails")] public static TOutput Receive( this ISourceBlock source, TimeSpan timeout, CancellationToken cancellationToken) { @@ -981,7 +975,6 @@ public static TOutput Receive( /// A that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. /// The which may be used to cancel the receive operation. /// A Task for the receive operation. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static Task ReceiveCore( this ISourceBlock source, bool attemptTryReceive, TimeSpan timeout, CancellationToken cancellationToken) { @@ -1048,7 +1041,6 @@ private enum ReceiveCoreByLinkingCleanupReason /// The source from which to receive. /// The number of milliseconds to wait, or -1 to wait indefinitely. /// The which may be used to cancel the receive operation. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static Task ReceiveCoreByLinking(ISourceBlock source, int millisecondsTimeout, CancellationToken cancellationToken) { // Create a target to link from the source @@ -1114,7 +1106,6 @@ private static Task ReceiveCoreByLinking(ISourceBlock /// Provides a TaskCompletionSource that is also a dataflow target for use in ReceiveCore. /// Specifies the type of data offered to the target. - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] private sealed class ReceiveTarget : TaskCompletionSource, ITargetBlock, IDebuggerDisplay { @@ -1159,7 +1150,6 @@ private sealed class ReceiveTarget : TaskCompletionSource, ITargetBlock internal ReceiveTarget() { } /// Offers a message to be used to complete the TaskCompletionSource. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] DataflowMessageStatus ITargetBlock.OfferMessage(DataflowMessageHeader messageHeader, T messageValue, ISourceBlock source, bool consumeToAccept) { // Validate arguments @@ -1239,8 +1229,6 @@ internal bool TryCleanupAndComplete(ReceiveCoreByLinkingCleanupReason reason) /// Cleans up the target for completion. /// The reason we're completing and cleaning up. /// This method must only be called once on this instance. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - [SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes")] private void CleanupAndComplete(ReceiveCoreByLinkingCleanupReason reason) { Common.ContractAssertMonitorStatus(IncomingLock, held: false); @@ -1376,7 +1364,6 @@ void IDataflowBlock.Complete() Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -1424,9 +1411,6 @@ public static Task OutputAvailableAsync(this ISourceBlock - [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] public static Task OutputAvailableAsync( this ISourceBlock source, CancellationToken cancellationToken) { @@ -1574,7 +1558,6 @@ void IDataflowBlock.Fault(Exception exception) Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -1695,7 +1678,6 @@ public void ReleaseReservation(DataflowMessageHeader messageHeader, ITargetBlock } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -1798,7 +1780,6 @@ public static Task Choose( /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] public static Task Choose( ISourceBlock source1, Action action1, ISourceBlock source2, Action action2, @@ -1889,7 +1870,6 @@ public static Task Choose( /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] public static Task Choose( ISourceBlock source1, Action action1, ISourceBlock source2, Action action2, @@ -1922,8 +1902,6 @@ public static Task Choose( /// The third source. /// The handler to execute on data from the third source. /// The options with which to configure this choice. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] private static Task ChooseCore( ISourceBlock source1, Action action1, ISourceBlock source2, Action action2, @@ -2009,8 +1987,6 @@ private static bool TryChooseFromSource( /// The third source. /// The handler to execute on data from the third source. /// The options with which to configure this choice. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] private static Task ChooseCoreByLinking( ISourceBlock source1, Action action1, ISourceBlock source2, Action action2, @@ -2106,7 +2082,6 @@ private static Task ChooseCoreByLinking( /// The source with which this branch is associated. /// The action to run for a single element received from the source. /// A task representing the branch. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static Task CreateChooseBranch( StrongBox boxedCompleted, CancellationTokenSource cts, TaskScheduler scheduler, @@ -2246,7 +2221,6 @@ void IDataflowBlock.Complete() Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -2331,7 +2305,6 @@ private AggregateException GetCompletionError() /// Subscribes the observer to the source. /// the observer to subscribe. /// An IDisposable that may be used to unsubscribe the source. - [SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")] IDisposable IObservable.Subscribe(IObserver observer) { // Validate arguments @@ -2432,7 +2405,6 @@ private ImmutableArray> ResetObserverState() } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -2466,7 +2438,6 @@ public DebugView(SourceObservable observable) } /// State associated with the current target for propagating data to observers. - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] private sealed class ObserversState { /// The owning SourceObservable. @@ -2526,7 +2497,6 @@ internal ObserversState(SourceObservable observable) /// Forwards an item to all currently subscribed observers. /// The item to forward. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private Task ProcessItemAsync(TOutput item) { Common.ContractAssertMonitorStatus(Observable._SubscriptionLock, held: false); @@ -2588,7 +2558,6 @@ private Task ProcessItemAsync(TOutput item) /// Non-null when an unexpected exception occurs during processing. Faults /// all subscribed observers and resets the observable back to its original condition. /// - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void NotifyObserversOfCompletion(Exception targetException = null) { Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); @@ -2696,7 +2665,6 @@ internal Task SendAsyncToTarget(TInput value) } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Base/ISourceBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Base/ISourceBlock.cs index 54db56117e0159..8b5406674d11ae 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Base/ISourceBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Base/ISourceBlock.cs @@ -28,7 +28,6 @@ public interface ISourceBlock : IDataflowBlock // IMPLEMENT EXPLICITLY /// - [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#")] TOutput ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock target, out bool messageConsumed); /// diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/ActionBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/ActionBlock.cs index 5e56fc10b0136d..f6875321a68dd0 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/ActionBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/ActionBlock.cs @@ -151,7 +151,6 @@ private void ProcessMessage(Action action, KeyValuePair me /// Processes the message with a user-provided action that returns a task. /// The action to use to process the message. /// The message to be processed. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessageWithTask(Func action, KeyValuePair messageWithId) { Debug.Assert(action != null, "action needed for processing"); @@ -304,7 +303,6 @@ public override string ToString() } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchBlock.cs index 72ed91712928a2..8c18c716e48355 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchBlock.cs @@ -24,7 +24,6 @@ namespace System.Threading.Tasks.Dataflow /// Specifies the type of data put into batches. [DebuggerDisplay("{DebuggerDisplayContent,nq}")] [DebuggerTypeProxy(typeof(BatchBlock<>.DebugView))] - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] public sealed class BatchBlock : IPropagatorBlock, IReceivableSourceBlock, IDebuggerDisplay { /// The target half of this batch. @@ -180,7 +179,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeader, I public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -246,7 +244,6 @@ public DebugView(BatchBlock batchBlock) } /// Provides the core target implementation for a Batch. - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] private sealed class BatchBlockTargetCore { @@ -435,7 +432,6 @@ internal DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, /// In general, it is not safe to pass releaseReservedMessages:true, because releasing of reserved messages /// is done without taking a lock. We pass releaseReservedMessages:true only when an exception has been /// caught inside the message processing loop which is a single instance at any given moment. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal void Complete(Exception exception, bool dropPendingMessages, bool releaseReservedMessages, bool revertProcessingState = false) { // Ensure that no new messages may be added @@ -666,7 +662,6 @@ private void ProcessAsyncIfNecessary_Slow(bool isReplacementReplica) /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessagesLoopCore() { Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); @@ -1086,7 +1081,6 @@ private void ConsumeReservedMessagesGreedyBounded() /// Whether to allow an exception from a release to propagate immediately, /// or to delay propagation until all releases have been attempted. /// - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal void ReleaseReservedMessages(bool throwOnFirstException) { Common.ContractAssertMonitorStatus(IncomingLock, held: false); @@ -1164,7 +1158,6 @@ internal static int CountItems(T[] singleOutputItem, IList multipleOutputIt internal DebuggingInformation GetDebuggingInformation() { return new DebuggingInformation(this); } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchedJoinBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchedJoinBlock.cs index f72a62b99641f1..4b961f52e90623 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchedJoinBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BatchedJoinBlock.cs @@ -126,21 +126,18 @@ public BatchedJoinBlock(int batchSize, GroupingDataflowBlockOptions dataflowBloc public ITargetBlock Target2 { get { return _target2; } } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public IDisposable LinkTo(ITargetBlock, IList>> target, DataflowLinkOptions linkOptions) { return _source.LinkTo(target, linkOptions); } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceive(Predicate, IList>> filter, out Tuple, IList> item) { return _source.TryReceive(filter, out item); } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceiveAll(out IList, IList>> items) { return _source.TryReceiveAll(out items); } /// @@ -212,7 +209,6 @@ private void CompleteEachTarget() public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -283,7 +279,6 @@ public DebugView(BatchedJoinBlock batchedJoinBlock) /// Specifies the type of data accepted by the block's third target. [DebuggerDisplay("{DebuggerDisplayContent,nq}")] [DebuggerTypeProxy(typeof(BatchedJoinBlock<,,>.DebugView))] - [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public sealed class BatchedJoinBlock : IReceivableSourceBlock, IList, IList>>, IDebuggerDisplay { /// The size of the batches generated by this BatchedJoin. @@ -398,14 +393,12 @@ public IDisposable LinkTo(ITargetBlock, IList, IList>> t } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceive(Predicate, IList, IList>> filter, out Tuple, IList, IList> item) { return _source.TryReceive(filter, out item); } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceiveAll(out IList, IList, IList>> items) { return _source.TryReceiveAll(out items); } /// @@ -480,7 +473,6 @@ private void CompleteEachTarget() public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -651,7 +643,6 @@ void IDataflowBlock.Fault(Exception exception) Task IDataflowBlock.Completion { get { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BroadcastBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BroadcastBlock.cs index 736055e0a3c842..ab471333b62b5a 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BroadcastBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BroadcastBlock.cs @@ -280,7 +280,6 @@ internal void ConsumeAsyncIfNecessary(bool isReplacementReplica = false) } /// Task body used to consume postponed messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ConsumeMessagesLoopCore() { Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, @@ -445,7 +444,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeader, ITa public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -503,7 +501,6 @@ public DebugView(BroadcastBlock broadcastBlock) /// Provides a core implementation for blocks that implement . /// Specifies the type of data supplied by the . - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] private sealed class BroadcastingSourceCore { @@ -886,7 +883,6 @@ private void OfferAsyncIfNecessary(bool isReplacementReplica = false) } /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void OfferMessagesLoopCore() { try @@ -1022,7 +1018,6 @@ private void CompleteBlockOncePossible() } /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal IDisposable LinkTo(ITargetBlock target, DataflowLinkOptions linkOptions) { // Validate arguments @@ -1201,7 +1196,6 @@ internal void AddExceptions(List exceptions) internal DataflowBlockOptions DataflowBlockOptions { get { return _dataflowBlockOptions; } } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BufferBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BufferBlock.cs index cfbf0b7f9c8d37..d9dce57b4d9b49 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BufferBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/BufferBlock.cs @@ -281,7 +281,6 @@ internal void ConsumeAsyncIfNecessary(bool isReplacementReplica = false) /// Task body used to consume postponed messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ConsumeMessagesLoopCore() { Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, @@ -427,7 +426,6 @@ private void CompleteTargetIfPossible() public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs index 6772ead392f796..b5d405247ed6e1 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs @@ -123,7 +123,6 @@ public bool TryReceive(Predicate> filter, out Tuple item) } /// - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceiveAll(out IList> items) { return _source.TryReceiveAll(out items); } /// @@ -189,7 +188,6 @@ void ISourceBlock>.ReleaseReservation(DataflowMessageHeader messag public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -259,7 +257,6 @@ public DebugView(JoinBlock joinBlock) /// Specifies the type of data accepted by the block's third target. [DebuggerDisplay("{DebuggerDisplayContent,nq}")] [DebuggerTypeProxy(typeof(JoinBlock<,,>.DebugView))] - [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes")] public sealed class JoinBlock : IReceivableSourceBlock>, IDebuggerDisplay { /// Resources shared by all targets for this join block. @@ -354,7 +351,6 @@ public bool TryReceive(Predicate> filter, out Tuple - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public bool TryReceiveAll(out IList> items) { return _source.TryReceiveAll(out items); } /// @@ -425,7 +421,6 @@ void ISourceBlock>.ReleaseReservation(DataflowMessageHeader me public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -904,7 +899,6 @@ DataflowMessageStatus ITargetBlock.OfferMessage(DataflowMessageHeader message /// In general, it is not safe to pass releaseReservedMessages:true, because releasing of reserved messages /// is done without taking a lock. We pass releaseReservedMessages:true only when an exception has been /// caught inside the message processing loop which is a single instance at any given moment. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal override void CompleteCore(Exception exception, bool dropPendingMessages, bool releaseReservedMessages) { bool greedy = _sharedResources._dataflowBlockOptions.Greedy; @@ -963,7 +957,6 @@ void IDataflowBlock.Fault(Exception exception) private int InputCountForDebugger { get { return _messages != null ? _messages.Count : _nonGreedy.ConsumedMessage.Key ? 1 : 0; } } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get @@ -1036,7 +1029,6 @@ internal abstract class JoinBlockTargetBase } /// Provides a container for resources shared across all targets used by the same BatchedJoin instance. - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] internal sealed class JoinBlockTargetSharedResources { @@ -1370,7 +1362,6 @@ internal void CompleteBlockIfPossible() } /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessagesLoopCore() { Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); @@ -1461,8 +1452,6 @@ internal void OnItemsRemoved(int numItemsRemoved) } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformBlock.cs index d5bae0219793af..1dacf7e0d9ad72 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformBlock.cs @@ -64,7 +64,6 @@ public TransformBlock(Func transform, ExecutionDataflowBlockOpt /// Initializes the with the specified . /// The function to invoke with each data element received. /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformBlock(Func> transform) : this(null, transform, ExecutionDataflowBlockOptions.Default) { } @@ -77,7 +76,6 @@ public TransformBlock(Func> transform) : /// The options with which to configure this . /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformBlock(Func> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) : this(null, transform, dataflowBlockOptions) { } @@ -223,7 +221,6 @@ private void ProcessMessage(Func transform, KeyValuePairProcesses the message with a user-provided transform function that returns a task of TOutput. /// The transform function to use to process the message. /// The message to be processed. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessageWithTask(Func> transform, KeyValuePair messageWithId) { Debug.Assert(transform != null, "Function to invoke is required."); @@ -398,7 +395,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeade public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformManyBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformManyBlock.cs index 2355d1d7a16b04..612ac2dfd81675 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformManyBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/TransformManyBlock.cs @@ -53,7 +53,6 @@ public sealed class TransformManyBlock : IPropagatorBlock. /// /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformManyBlock(Func> transform) : this(transform, null, ExecutionDataflowBlockOptions.Default) { } @@ -66,7 +65,6 @@ public TransformManyBlock(Func> transform) : /// The options with which to configure this . /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformManyBlock(Func> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) : this(transform, null, dataflowBlockOptions) { } @@ -77,7 +75,6 @@ public TransformManyBlock(Func> transform, Executio /// will be made available as output from this . /// /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformManyBlock(Func>> transform) : this(null, transform, ExecutionDataflowBlockOptions.Default) { } @@ -90,7 +87,6 @@ public TransformManyBlock(Func>> transform) : /// The options with which to configure this . /// The is null (Nothing in Visual Basic). /// The is null (Nothing in Visual Basic). - [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public TransformManyBlock(Func>> transform, ExecutionDataflowBlockOptions dataflowBlockOptions) : this(null, transform, dataflowBlockOptions) { } @@ -218,7 +214,6 @@ private void ProcessMessage(Func> transformFunction /// Processes the message with a user-provided transform function that returns an observable. /// The transform function to use to process the message. /// The message to be processed. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessageWithTask(Func>> function, KeyValuePair messageWithId) { Debug.Assert(function != null, "Function to invoke is required."); @@ -279,7 +274,6 @@ private void ProcessMessageWithTask(Func>> fun /// Completes the processing of an asynchronous message. /// The completed task storing the output data generated for an input message. /// The originating message - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void AsyncCompleteProcessMessageWithTask( Task> completed, KeyValuePair messageWithId) { @@ -634,7 +628,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeade public override string ToString() { return Common.GetNameForDebugger(this, _source.DataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/WriteOnceBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/WriteOnceBlock.cs index 37cc854a44d6b5..8a0b29da851d83 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/WriteOnceBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/WriteOnceBlock.cs @@ -110,7 +110,6 @@ public WriteOnceBlock(Func cloningFunction, DataflowBlockOptions dataflowB /// /// This must only be called once all of the completion conditions are met. /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] private void CompleteBlockAsync(IList exceptions) { Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); @@ -303,7 +302,6 @@ bool IReceivableSourceBlock.TryReceiveAll(out IList items) } /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public IDisposable LinkTo(ITargetBlock target, DataflowLinkOptions linkOptions) { // Validate arguments @@ -449,7 +447,6 @@ private T CloneItem(T item) } /// Offers the WriteOnceBlock's message to all targets. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private List OfferToTargets() { Common.ContractAssertMonitorStatus(ValueLock, held: false); @@ -515,7 +512,6 @@ private TaskCompletionSource CompletionTaskSource public override string ToString() { return Common.GetNameForDebugger(this, _dataflowBlockOptions); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ActionOnDispose.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ActionOnDispose.cs index ed5a06ac6b3682..bb87f432aef4c8 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ActionOnDispose.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ActionOnDispose.cs @@ -81,7 +81,6 @@ internal Disposable(Action action, T1 arg1, T2 arg2) } /// Gets whether the IDisposable has been disposed. - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] private bool Disposed { get { return _action == null; } } /// Invoke the action. @@ -124,7 +123,6 @@ internal Disposable(Action action, T1 arg1, T2 arg2, T3 arg3) } /// Gets whether the IDisposable has been disposed. - [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] private bool Disposed { get { return _action == null; } } /// Invoke the action. diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs index ef8e825ad52874..b915ca1bd2621b 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs @@ -120,8 +120,6 @@ internal static int GetBlockId(IDataflowBlock block) /// /// The name of the object. /// This is used from DebuggerDisplay attributes. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] internal static string GetNameForDebugger( IDataflowBlock block, DataflowBlockOptions options = null) { @@ -206,7 +204,6 @@ internal static void WireCancellationToComplete( /// Initializes the stack trace and watson bucket of an inactive exception. /// The exception to initialize. /// The initialized exception. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal static Exception InitializeStackTrace(Exception exception) { Debug.Assert(exception != null && exception.StackTrace == null, @@ -223,7 +220,6 @@ internal static Exception InitializeStackTrace(Exception exception) /// The Exception whose Data collection should store message information. /// The message information to be stored. /// Whether to store the data into the exception's inner exception(s) in addition to the exception itself. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal static void StoreDataflowMessageValueIntoExceptionData(Exception exc, T messageValue, bool targetInnerExceptions = false) { Debug.Assert(exc != null, "The exception into which data should be stored must be provided."); @@ -268,7 +264,6 @@ internal static void StoreDataflowMessageValueIntoExceptionData(Exception exc /// The key. /// The value to be serialized as a string and stored. /// If the key is already present in the exception's data dictionary, the value is not overwritten. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static void StoreStringIntoExceptionData(Exception exception, string key, string value) { Debug.Assert(exception != null, "An exception is needed to store the data into."); @@ -369,7 +364,6 @@ internal static Task CreateTaskFromException(Exception excepti /// Creates a task canceled with the specified cancellation token. /// Specifies the type of the result for this task. /// The canceled task. - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal static Task CreateTaskFromCancellation(CancellationToken cancellationToken) { Debug.Assert(cancellationToken.IsCancellationRequested, @@ -468,8 +462,6 @@ internal static Exception StartTaskSafe(Task task, TaskScheduler scheduler) /// Task to be started. /// TaskScheduler to schedule the task on. /// null on success, an exception reference on scheduling error. In the latter case, the task reference is nulled out. - [SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals")] - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private static Exception StartTaskSafeCore(Task task, TaskScheduler scheduler) { Debug.Assert(task != null, "Task to start is needed."); @@ -497,7 +489,6 @@ private static Exception StartTaskSafeCore(Task task, TaskScheduler scheduler) /// Pops and explicitly releases postponed messages after the block is done with processing. /// No locks should be held at this time. Unfortunately we cannot assert that. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] internal static void ReleaseAllPostponedMessages(ITargetBlock target, QueuedMap, DataflowMessageHeader> postponedMessages, ref List exceptions) @@ -690,7 +681,6 @@ internal BoundingStateWithPostponedAndTask(int boundedCapacity) : base(boundedCa /// to ensure that the resulting task can't be upcast to something /// that in the future could lead to compat problems. /// - [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] [DebuggerNonUserCode] internal struct VoidResult { } } diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/DataflowEtwProvider.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/DataflowEtwProvider.cs index dc0b1262301ebf..db0c6a777a9d61 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/DataflowEtwProvider.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/DataflowEtwProvider.cs @@ -125,7 +125,6 @@ internal enum TaskLaunchedReason #region Block Completion /// Trace an event for a block completing. /// The block that's completing. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] [NonEvent] internal void DataflowBlockCompleted(IDataflowBlock block) { diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SourceCore.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SourceCore.cs index c1f4679dd7cbab..57f701ad30869e 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SourceCore.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SourceCore.cs @@ -28,7 +28,6 @@ namespace System.Threading.Tasks.Dataflow.Internal /// Provides a core implementation for blocks that implement . /// Specifies the type of data supplied by the . - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] internal sealed class SourceCore { @@ -123,7 +122,6 @@ internal SourceCore( } /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] internal IDisposable LinkTo(ITargetBlock target, DataflowLinkOptions linkOptions) { // Validate arguments @@ -792,7 +790,6 @@ private void OfferAsyncIfNecessary_Slow(bool isReplacementReplica, bool outgoing } /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void OfferMessagesLoopCore() { Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, @@ -980,7 +977,6 @@ private void CompleteBlockOncePossible() } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SpscTargetCore.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SpscTargetCore.cs index 3f30d4246ce6aa..f742443ece9a37 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SpscTargetCore.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/SpscTargetCore.cs @@ -157,7 +157,6 @@ private DataflowMessageStatus OfferMessage_Slow(DataflowMessageHeader messageHea /// Schedules a consumer task if there's none currently running. /// Whether the new consumer is being scheduled to replace a currently running consumer. - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] private void ScheduleConsumerIfNecessary(bool isReplica) { // If there's currently no active task... @@ -191,7 +190,6 @@ private void ScheduleConsumerIfNecessary(bool isReplica) } /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessagesLoopCore() { Debug.Assert( @@ -375,7 +373,6 @@ private TaskCompletionSource CompletionSource internal DebuggingInformation GetDebuggingInformation() { return new DebuggingInformation(this); } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetCore.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetCore.cs index ad73a8a1a0d75b..f3aa761e2b9924 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetCore.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetCore.cs @@ -42,7 +42,6 @@ internal enum TargetCoreOptions : byte /// /// Provides a core implementation of . /// Specifies the type of data accepted by the . - [SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable")] [DebuggerDisplay("{DebuggerDisplayContent,nq}")] internal sealed class TargetCore { @@ -350,7 +349,6 @@ private void ProcessAsyncIfNecessary(bool repeat = false) /// Slow path for ProcessAsyncIfNecessary. /// Separating out the slow path into its own method makes it more likely that the fast path method will get inlined. /// - [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] private void ProcessAsyncIfNecessary_Slow(bool repeat) { Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously."); @@ -397,7 +395,6 @@ private void ProcessAsyncIfNecessary_Slow(bool repeat) } /// Task body used to process messages. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void ProcessMessagesLoopCore() { Common.ContractAssertMonitorStatus(IncomingLock, held: false); @@ -523,7 +520,6 @@ private void ProcessMessagesLoopCore() /// Retrieves the next message from the input queue for the useAsyncCompletion mode. /// The next message retrieved. /// true if a message was found and removed; otherwise, false. - [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private bool TryGetNextMessageForNewAsyncOperation(out KeyValuePair messageWithId) { Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode."); @@ -822,7 +818,6 @@ internal void ChangeBoundingCount(int count) } /// Gets the object to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetRegistry.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetRegistry.cs index f3c78aaa4a21a9..c75a644c54ce65 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetRegistry.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/TargetRegistry.cs @@ -360,7 +360,6 @@ void ISourceBlock.ReleaseReservation(DataflowMessageHeader messageHeader, ITa IDisposable ISourceBlock.LinkTo(ITargetBlock target, DataflowLinkOptions linkOptions) { throw new NotSupportedException(SR.NotSupported_MemberNotNeeded); } /// The data to display in the debugger display attribute. - [SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider")] private object DebuggerDisplayContent { get diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs index f564ba4f4af743..8c5a2649a5ae60 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/CommittableTransaction.cs @@ -7,7 +7,6 @@ namespace System.Transactions { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Serialization not yet supported and will be done using DistributedTransaction")] public sealed class CommittableTransaction : Transaction, IAsyncResult { internal bool _completedSynchronously = false; diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/DependentTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/DependentTransaction.cs index 4ca8232cc002e8..dbc56cdbfcc086 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/DependentTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/DependentTransaction.cs @@ -6,7 +6,6 @@ namespace System.Transactions { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Serialization not yet supported and will be done using DistributedTransaction")] public sealed class DependentTransaction : Transaction { private readonly bool _blocking; diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/SubordinateTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/SubordinateTransaction.cs index 5fed0b709349e5..860e2814ec0616 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/SubordinateTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/SubordinateTransaction.cs @@ -4,7 +4,6 @@ namespace System.Transactions { - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Serialization not yet supported and will be done using DistributedTransaction")] public sealed class SubordinateTransaction : Transaction { // Create a transaction with the given settings diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs index 66b94ca424fa62..89666616e0a20a 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs @@ -53,7 +53,6 @@ public enum EnlistmentOptions // When we serialize a Transaction, we specify the type DistributedTransaction, so a Transaction never // actually gets deserialized. - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229", Justification = "Serialization not yet supported and will be done using DistributedTransaction")] public class Transaction : IDisposable, ISerializable { // UseServiceDomain diff --git a/src/libraries/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs b/src/libraries/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs index a0f2d4a65d4af3..26adef0412d444 100644 --- a/src/libraries/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs +++ b/src/libraries/System.Web.HttpUtility/src/System/Web/Util/HttpEncoder.cs @@ -607,8 +607,6 @@ private static byte[] UrlEncodeNonAscii(byte[] bytes, int offset, int count) return sb.ToString(); } - [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", - Justification = "Does not represent an entire URL, just a portion.")] [return: NotNullIfNotNull("value")] internal static string? UrlPathEncode(string? value) { @@ -635,8 +633,6 @@ private static byte[] UrlEncodeNonAscii(byte[] bytes, int offset, int count) } // This is the original UrlPathEncode(string) - [SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", - Justification = "Does not represent an entire URL, just a portion.")] private static string UrlPathEncodeImpl(string value) { if (string.IsNullOrEmpty(value))