Skip to content

Commit 7bfa839

Browse files
Keegan CarusoHP712
authored andcommitted
Only use fxcop in netfw
1 parent 2cde86c commit 7bfa839

54 files changed

Lines changed: 97 additions & 180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/common.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,11 @@
6565
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" PrivateAssets="All"/>
6666
</ItemGroup>
6767

68+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
69+
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1">
70+
<PrivateAssets>all</PrivateAssets>
71+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
72+
</PackageReference>
73+
</ItemGroup>
74+
6875
</Project>

src/Microsoft.IdentityModel.Abstractions/Microsoft.IdentityModel.Abstractions.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,4 @@
1717
<DebugSymbols>true</DebugSymbols>
1818
</PropertyGroup>
1919

20-
<ItemGroup>
21-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
22-
<PrivateAssets>all</PrivateAssets>
23-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24-
</PackageReference>
25-
</ItemGroup>
26-
2720
</Project>

src/Microsoft.IdentityModel.JsonWebTokens/JsonWebToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ internal JsonClaimSet CreateClaimSet(ReadOnlySpan<char> strSpan, int startIndex,
588588
/// <returns>Encoded token string without signature or authentication tag.</returns>
589589
public override string ToString()
590590
{
591-
return EncodedToken.Substring(0, EncodedToken.LastIndexOf("."));
591+
return EncodedToken.Substring(0, EncodedToken.LastIndexOf('.'));
592592
}
593593

594594
/// <inheritdoc/>

src/Microsoft.IdentityModel.JsonWebTokens/JsonWebTokenHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public partial class JsonWebTokenHandler : TokenHandler
3131
/// <summary>
3232
/// Default value for the flag that determines whether or not the InboundClaimTypeMap is used.
3333
/// </summary>
34-
public static bool DefaultMapInboundClaims = false;
34+
public static bool DefaultMapInboundClaims;
3535

3636
/// <summary>
3737
/// Gets the Base64Url encoded string representation of the following JWT header:

src/Microsoft.IdentityModel.JsonWebTokens/JwtTokenUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ internal static string SafeLogJwtToken(object obj)
496496
if (!(obj is string token))
497497
return obj.GetType().ToString();
498498

499-
int lastDot = token.LastIndexOf(".");
499+
int lastDot = token.LastIndexOf('.');
500500

501501
// no dots, not a JWT, we do not know how to sanitize so we return UnrecognizedEncodedToken
502502
if (lastDot == -1)

src/Microsoft.IdentityModel.JsonWebTokens/Microsoft.IdentityModel.JsonWebTokens.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@
1616
<DebugSymbols>true</DebugSymbols>
1717
</PropertyGroup>
1818

19-
<ItemGroup>
20-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
21-
<PrivateAssets>all</PrivateAssets>
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23-
</PackageReference>
24-
</ItemGroup>
25-
2619
<ItemGroup>
2720
<ProjectReference Include="..\Microsoft.IdentityModel.Tokens\Microsoft.IdentityModel.Tokens.csproj" />
2821
</ItemGroup>

src/Microsoft.IdentityModel.Logging/IdentityModelEventSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ private IdentityModelEventSource()
3333
/// <summary>
3434
/// Flag which indicates whether or not PII is shown in logs. False by default.
3535
/// </summary>
36-
public static bool ShowPII { get; set; } = false;
36+
public static bool ShowPII { get; set; }
3737

3838
/// <summary>
3939
/// Flag which indicates whether or not complete <see cref="SecurityArtifact"/> is shown in logs when <see cref="ShowPII"/> is set to true. False by default.
4040
/// </summary>
41-
public static bool LogCompleteSecurityArtifact { get; set; } = false;
41+
public static bool LogCompleteSecurityArtifact { get; set; }
4242

4343
/// <summary>
4444
/// String that is used in place of any arguments to log messages if the 'ShowPII' flag is set to false.
@@ -53,7 +53,7 @@ private IdentityModelEventSource()
5353
/// <summary>
5454
/// Indicates whether or the log message header (contains library version, date/time, and PII debugging information) has been written.
5555
/// </summary>
56-
public static bool HeaderWritten { get; set; } = false;
56+
public static bool HeaderWritten { get; set; }
5757

5858
/// <summary>
5959
/// The log message that indicates the current library version.

src/Microsoft.IdentityModel.Logging/LogHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class LogHelper
2323
/// <summary>
2424
/// Indicates whether the log message header (contains library version, date/time, and PII debugging information) has been written.
2525
/// </summary>
26-
private static bool _isHeaderWritten = false;
26+
private static bool _isHeaderWritten;
2727

2828
/// <summary>
2929
/// The log message that is shown when PII is off.

src/Microsoft.IdentityModel.Logging/LoggerContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public LoggerContext(Guid activityId)
3737
/// Gets or sets a boolean controlling if logs are written into the context.
3838
/// Useful when debugging.
3939
/// </summary>
40-
public bool CaptureLogs { get; set; } = false;
40+
public bool CaptureLogs { get; set; }
4141

4242
/// <summary>
4343
/// Gets or sets a string that helps with setting breakpoints when debugging.

src/Microsoft.IdentityModel.Logging/Microsoft.IdentityModel.Logging.csproj

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,11 @@
2020
<Compile Include="..\Common\TrimmingAttributes.cs" LinkBase="Common"
2121
Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
2222
</ItemGroup>
23-
23+
2424
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
2525
<Reference Include="System.Net.Http" />
2626
</ItemGroup>
2727

28-
<ItemGroup>
29-
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
30-
<PrivateAssets>all</PrivateAssets>
31-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
32-
</PackageReference>
33-
</ItemGroup>
34-
3528
<ItemGroup>
3629
<ProjectReference Include="..\Microsoft.IdentityModel.Abstractions\Microsoft.IdentityModel.Abstractions.csproj" />
3730
</ItemGroup>

0 commit comments

Comments
 (0)