Skip to content

Commit 5cbb890

Browse files
Clean up code analysis
1 parent 499fa9e commit 5cbb890

6 files changed

+23
-13
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ csharp_space_between_method_declaration_parameter_list_parentheses = true
9090
csharp_space_between_method_call_parameter_list_parentheses = true
9191
csharp_space_between_parentheses = control_flow_statements, expressions
9292

93-
# ide code suppressions
94-
# dotnet_diagnostic.IDE0079.severity = none
95-
9693
# style code suppressions
9794
dotnet_diagnostic.SA1002.severity = none
9895
dotnet_diagnostic.SA1003.severity = none

src/Common/src/Common.Backport/NullableAttributes.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// Copyright (c) .NET Foundation and contributors. All rights reserved.
22

3-
#pragma warning disable SA1402, SA1649
3+
#pragma warning disable IDE0060
4+
#pragma warning disable IDE0079
5+
#pragma warning disable SA1402
6+
#pragma warning disable SA1649
47

58
// REF: https://github.com/dotnet/runtime/blob/1c8d37af80667daffb3cb80ce0fe915621e8f039/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
69
//

src/Common/src/Common.OData.ApiExplorer/Conventions/ODataActionQueryOptionsConventionBuilder{T}.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ public class ODataActionQueryOptionsConventionBuilder<T> :
3232
IODataActionQueryOptionsConventionBuilder<T>
3333
where T : notnull
3434
#if NETFRAMEWORK
35+
#pragma warning disable IDE0079
3536
#pragma warning disable SA1001 // Commas should be spaced correctly
3637
, IHttpController
3738
#pragma warning restore SA1001 // Commas should be spaced correctly
39+
#pragma warning restore IDE0079
3840
#endif
3941
{
4042
/// <summary>

src/Common/src/Common.OData.ApiExplorer/Conventions/ODataControllerQueryOptionsConventionBuilder{T}.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ public class ODataControllerQueryOptionsConventionBuilder<T> :
2020
IODataActionQueryOptionsConventionBuilder<T>
2121
where T : notnull
2222
#if NETFRAMEWORK
23+
#pragma warning disable IDE0079
2324
#pragma warning disable SA1001 // Commas should be spaced correctly
2425
, IHttpController
2526
#pragma warning restore SA1001 // Commas should be spaced correctly
27+
#pragma warning restore IDE0079
2628
#endif
2729
{
2830
private ODataActionQueryOptionsConventionBuilderCollection<T>? actionBuilders;

src/Common/src/Common.OData.ApiExplorer/Conventions/ODataQueryOptionsConventionBuilder.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ public IODataQueryOptionDescriptionProvider DescriptionProvider
5959
public virtual ODataControllerQueryOptionsConventionBuilder<TController> Controller<TController>()
6060
where TController : notnull
6161
#if NETFRAMEWORK
62+
#pragma warning disable IDE0079
6263
#pragma warning disable SA1001 // Commas should be spaced correctly
6364
, IHttpController
6465
#pragma warning restore SA1001 // Commas should be spaced correctly
66+
#pragma warning restore IDE0079
6567
#endif
6668
{
6769
var key = typeof( TController );

src/Common/src/Common/MediaTypeApiVersionReaderBuilder.cs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,34 @@
1111
using MediaTypeHeaderValue = System.Net.Http.Headers.MediaTypeWithQualityHeaderValue;
1212
#else
1313
using Microsoft.AspNetCore.Http;
14+
using Microsoft.Extensions.Primitives;
1415
using Microsoft.Net.Http.Headers;
16+
using System.Collections.Frozen;
1517
#endif
1618

1719
namespace Asp.Versioning;
1820

1921
#if !NETFRAMEWORK
2022
using System.Buffers;
21-
using System.Collections.Frozen;
2223
#endif
2324
using System.Runtime.CompilerServices;
2425
using System.Text.RegularExpressions;
2526
#if NETFRAMEWORK
26-
using FrozenSet = System.Collections.Generic.HashSet<System.String>;
27-
using Str = string;
28-
using StrComparer = System.StringComparer;
27+
using FrozenSet = HashSet<String>;
2928
#else
30-
using FrozenSet = System.Collections.Frozen.FrozenSet<Microsoft.Extensions.Primitives.StringSegment>;
31-
using Str = Microsoft.Extensions.Primitives.StringSegment;
32-
using StrComparer = Microsoft.Extensions.Primitives.StringSegmentComparer;
29+
using FrozenSet = FrozenSet<StringSegment>;
3330
#endif
34-
using static Asp.Versioning.ApiVersionParameterLocation;
35-
using static System.StringComparison;
3631
using ReaderCallback = Func<IReadOnlyList<MediaTypeHeaderValue>, IReadOnlyList<string>>;
3732
using SelectorCallback = Func<HttpRequest, IReadOnlyList<string>, IReadOnlyList<string>>;
33+
#if NETFRAMEWORK
34+
using Str = String;
35+
using StrComparer = StringComparer;
36+
#else
37+
using Str = StringSegment;
38+
using StrComparer = StringSegmentComparer;
39+
#endif
40+
using static Asp.Versioning.ApiVersionParameterLocation;
41+
using static System.StringComparison;
3842

3943
/// <summary>
4044
/// Represents a builder for an API version reader that reads the value from a media type HTTP header in the request.

0 commit comments

Comments
 (0)