Skip to content

Commit

Permalink
Fix suppression for CA3053 to reference proper category and checkid.
Browse files Browse the repository at this point in the history
  • Loading branch information
robward-ms authored and AlanWong-MS committed Apr 7, 2017
1 parent 072f6f7 commit 272c74a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
3 changes: 3 additions & 0 deletions src/Microsoft.OData.Core/Metadata/ODataMetadataReaderUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// </copyright>
//---------------------------------------------------------------------

using System.Diagnostics.CodeAnalysis;

namespace Microsoft.OData.Metadata
{
#region Namespaces
Expand All @@ -25,6 +27,7 @@ internal static class ODataMetadataReaderUtils
/// <param name="encoding">The encoding to use to read the input.</param>
/// <param name="messageReaderSettings">The OData message reader settings used to control the settings of the Xml reader.</param>
/// <returns>An <see cref="XmlReader"/> instance configured with the provided settings.</returns>
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
internal static XmlReader CreateXmlReader(Stream stream, Encoding encoding, ODataMessageReaderSettings messageReaderSettings)
{
Debug.Assert(stream != null, "stream != null");
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.OData.Edm/Csdl/CsdlReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Xml;
Expand Down Expand Up @@ -651,9 +652,7 @@ private void ParseReferenceElement()
this.edmReferences.Add(result);
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
private void ParseSchemaElement()
{
Debug.Assert(this.reader.LocalName == CsdlConstants.Element_Schema, "Must call ParseCsdlSchemaElement on Schema Element");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Xml;
using Microsoft.OData.Edm.Validation;
Expand Down Expand Up @@ -43,9 +44,7 @@ internal XmlAttributeInfo GetRequiredAttribute(XmlElementInfo element, string at
return attr;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
protected override XmlReader InitializeReader(XmlReader reader)
{
XmlReaderSettings readerSettings = new XmlReaderSettings
Expand Down
5 changes: 2 additions & 3 deletions src/Microsoft.OData.Edm/Validation/ValidationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Xml;
Expand Down Expand Up @@ -73,9 +74,7 @@ internal static bool PropertySetsAreEquivalent(IEnumerable<IEdmStructuralPropert
return true;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
internal static bool ValidateValueCanBeWrittenAsXmlElementAnnotation(IEdmValue value, string annotationNamespace, string annotationName, out EdmError error)
{
IEdmStringValue edmStringValue = value as IEdmStringValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ public static class AlternateKeysVocabularyModel
/// <summary>
/// Parse Alternate Keys Vocabulary Model from AlternateKeysVocabularies.xml
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
static AlternateKeysVocabularyModel()
{
Assembly assembly = typeof(AlternateKeysVocabularyModel).GetAssembly();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Reflection;
using System.Xml;
Expand All @@ -32,9 +33,7 @@ internal class CapabilitiesVocabularyModel
/// <summary>
/// Parse Capabilities Vocabulary Model from CapabilitiesVocabularies.xml
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
static CapabilitiesVocabularyModel()
{
Assembly assembly = typeof(CapabilitiesVocabularyModel).GetAssembly();
Expand Down
4 changes: 1 addition & 3 deletions src/Microsoft.OData.Edm/Vocabularies/CoreVocabularyModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ public static class CoreVocabularyModel
/// <summary>
/// Parse Core Vocabulary Model from CoreVocabularies.xml
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.FxCop.Rules.Security.Xml.SecurityXmlRules", "CA3053:UseXmlSecureResolver",
MessageId = "System.Xml.XmlReader.Create",
Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
[SuppressMessage("Microsoft.Security.Xml", "CA3053", Justification = "The XmlResolver property no longer exists in .NET portable framework.")]
static CoreVocabularyModel()
{
IsInitializing = true;
Expand Down

0 comments on commit 272c74a

Please sign in to comment.