Skip to content

Commit ac13c9f

Browse files
author
Christy Henriksson
authored
Latest fxcop fixes (#6544)
1 parent 7e574fc commit ac13c9f

29 files changed

Lines changed: 17 additions & 95 deletions

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param (
1010
[string]$PackageSuffix,
1111
[string]$Branch,
1212
[string]$CommitSHA,
13-
[string]$BuildBranch = 'c35bbc228717720bdbc610f3285259391635e90e'
13+
[string]$BuildBranch = '80b8f1b4a1cfe57367881e59fca063866dcaaa42'
1414
)
1515

1616
Set-StrictMode -Version 1.0

src/GalleryTools/Commands/BackfillRepositoryMetadataCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ private static XDocument LoadXml(Stream stream)
252252
IgnoreComments = true,
253253
IgnoreProcessingInstructions = true,
254254
};
255+
settings.XmlResolver = null;
255256

256257
using (var streamReader = new StreamReader(stream))
257258
using (var xmlReader = XmlReader.Create(streamReader, settings))

src/NuGetGallery.Core/Certificates/CertificateFile.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.IO;
67
using System.Security.Cryptography;
78

@@ -62,6 +63,7 @@ private static MemoryStream CopyAsReadOnly(Stream source)
6263
}
6364
}
6465

66+
[SuppressMessage("Microsoft.Security.Cryptography", "CA5354:SHA1CannotBeUsed", Justification = @"SHA1 thumbprint is only used to distinguish certificates in the Gallery view.")]
6567
private static string GetSha1Thumbprint(MemoryStream stream)
6668
{
6769
using (var hashAlgorithm = SHA1.Create())

src/NuGetGallery.Core/Diagnostics/NullDiagnosticsSource.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Diagnostics.CodeAnalysis;
76
using Microsoft.Extensions.Logging;
87

98
namespace NuGetGallery.Diagnostics
109
{
1110
public class NullDiagnosticsSource : IDiagnosticsSource
1211
{
13-
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "Type is immutable")]
1412
public static readonly NullDiagnosticsSource Instance = new NullDiagnosticsSource();
1513

1614
private NullDiagnosticsSource() { }

src/NuGetGallery.Core/DisposableAction.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33

44
using System;
55
using System.Collections.Generic;
6-
using System.Diagnostics.CodeAnalysis;
76
using System.Linq;
87

98
namespace NuGetGallery
109
{
1110
public sealed class DisposableAction : IDisposable
1211
{
13-
[SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes", Justification = "This is immutable. Multiple calls to dispose will be complete no-op and there is no state stored.")]
1412
public static readonly DisposableAction NoOp = new DisposableAction(() => { });
1513

1614
private readonly Action _action;

src/NuGetGallery.Core/Entities/IEntitiesContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public interface IEntitiesContext
2121
IDbSet<SymbolPackage> SymbolPackages { get; set; }
2222

2323
Task<int> SaveChangesAsync();
24-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Set", Justification="This is to match the EF terminology.")]
2524
IDbSet<T> Set<T>() where T : class;
2625
void DeleteOnCommit<T>(T entity) where T : class;
2726
void SetCommandTimeout(int? seconds);

src/NuGetGallery.Core/NuGetGallery.Core.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
<DefineConstants>DEBUG;TRACE</DefineConstants>
3838
<ErrorReport>prompt</ErrorReport>
3939
<WarningLevel>4</WarningLevel>
40-
<CodeAnalysisRuleSet>..\Frontend.ruleset</CodeAnalysisRuleSet>
4140
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4241
</PropertyGroup>
4342
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

src/NuGetGallery.Core/Services/TestableStorageClientException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
34
using System;
45
using Microsoft.WindowsAzure.Storage;
56

67
namespace NuGetGallery
78
{
8-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Justification = "This is for unit tests only.")]
99
public class TestableStorageClientException : Exception
1010
{
1111
public TestableStorageClientException()

src/NuGetGallery/App_Start/DefaultDependenciesModule.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public static class BindingKeys
5050
public const string SymbolsPackageValidationEnqueuer = "SymbolsPackageValidationEnqueuerBindingKey";
5151
}
5252

53-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:CyclomaticComplexity", Justification = "This code is more maintainable in the same function.")]
5453
protected override void Load(ContainerBuilder builder)
5554
{
5655
var telemetryClient = TelemetryClientWrapper.Instance;

src/NuGetGallery/Areas/Admin/Controllers/HomeController.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using System.Diagnostics.CodeAnalysis;
65
using System.Web.Mvc;
76
using NuGetGallery.Areas.Admin.ViewModels;
87
using NuGetGallery.Configuration;
@@ -30,8 +29,6 @@ public virtual ActionResult Index()
3029
}
3130

3231
[HttpGet]
33-
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Throw", Justification="This is an admin action")]
34-
[SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Justification = "This is an admin action")]
3532
public virtual ActionResult Throw()
3633
{
3734
throw new Exception("KA BOOM!");

0 commit comments

Comments
 (0)