Remove unnecessary SuppressMessage attributes
Rob Mensching committed
Jan 7, 2021 at 15:37 UTC
458ff7ce24b33f6df46ae8ef728685c555d55ff7
4 files changed
-33
src/WixToolset.Core/Compiler.cs
-9
@@ -676,7 +676,6 @@ namespace WixToolset.Core
676
/// </summary>
677
/// <param name="node">Element to parse.</param>
678
/// <returns>Identifier for the new row.</returns>
679
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
679
private Identifier ParseBinaryElement(XElement node)
680
{
681
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -2102,7 +2101,6 @@ namespace WixToolset.Core
2101
/// <param name="diskId">Optional disk id inherited from parent directory.</param>
2102
/// <param name="directoryId">Optional identifier for component's directory.</param>
2103
/// <param name="srcPath">Optional source path for files up to this point.</param>
2105
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
2104
private void ParseComponentElement(XElement node, ComplexReferenceParentType parentType, string parentId, string parentLanguage, int diskId, string directoryId, string srcPath)
2105
{
2106
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -2573,7 +2571,6 @@ namespace WixToolset.Core
2571
/// <param name="node">Element to parse.</param>
2572
/// <param name="parentType"></param>
2573
/// <param name="parentId"></param>
2576
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
2574
private void ParseComponentGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId)
2575
{
2576
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -4135,7 +4132,6 @@ namespace WixToolset.Core
4132
/// <param name="parentId">Optional identifier of parent directory.</param>
4133
/// <param name="diskId">Disk id inherited from parent directory.</param>
4134
/// <param name="fileSource">Path to source file as of yet.</param>
4138
- [SuppressMessage("Microsoft.Performance", "CA1820:TestForEmptyStringsUsingStringLength")]
4135
private void ParseDirectoryElement(XElement node, string parentId, int diskId, string fileSource)
4136
{
4137
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -4363,7 +4359,6 @@ namespace WixToolset.Core
4359
/// Parses a directory reference element.
4360
/// </summary>
4361
/// <param name="node">Element to parse.</param>
4366
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
4362
private void ParseDirectoryRefElement(XElement node)
4363
{
4364
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -4711,7 +4706,6 @@ namespace WixToolset.Core
4706
/// <param name="parentId">Optional identifer for parent feature.</param>
4707
/// <param name="lastDisplay">Display value for last feature used to get the features to display in the same order as specified
4708
/// in the source code.</param>
4714
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
4709
private void ParseFeatureElement(XElement node, ComplexReferenceParentType parentType, string parentId, ref int lastDisplay)
4710
{
4711
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -4935,7 +4929,6 @@ namespace WixToolset.Core
4929
/// <param name="node">Element to parse.</param>
4930
/// <param name="parentType">The type of parent.</param>
4931
/// <param name="parentId">Optional identifier for parent feature.</param>
4938
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
4932
private void ParseFeatureRefElement(XElement node, ComplexReferenceParentType parentType, string parentId)
4933
{
4934
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -5029,7 +5022,6 @@ namespace WixToolset.Core
5022
/// <param name="node">Element to parse.</param>
5023
/// <param name="parentType"></param>
5024
/// <param name="parentId"></param>
5032
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
5025
private void ParseFeatureGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId)
5026
{
5027
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -5484,7 +5476,6 @@ namespace WixToolset.Core
5476
/// <param name="win64Component">true if the component is 64-bit.</param>
5477
/// <param name="componentGuid"></param>
5478
/// <returns>Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise.</returns>
5487
- [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
5479
private YesNoType ParseFileElement(XElement node, string componentId, string directoryId, int diskId, string sourcePath, out string possibleKeyPath, bool win64Component, string componentGuid)
5480
{
5481
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
src/WixToolset.Core/CompilerCore.cs
-11
@@ -493,7 +493,6 @@ namespace WixToolset.Core
493
/// <param name="attribute">The attribute containing the value to get.</param>
494
/// <param name="emptyRule">A rule for the contents of the value. If the contents do not follow the rule, an error is thrown.</param>
495
/// <returns>The attribute's value.</returns>
496
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
496
public string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly)
497
{
498
return this.parseHelper.GetAttributeValue(sourceLineNumbers, attribute, emptyRule);
@@ -505,7 +504,6 @@ namespace WixToolset.Core
504
/// <param name="sourceLineNumbers">Source line information about the owner element.</param>
505
/// <param name="attribute">The attribute containing the value to get.</param>
506
/// <returns>A valid code page integer value.</returns>
508
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
507
public int GetAttributeCodePageValue(SourceLineNumber sourceLineNumbers, XAttribute attribute)
508
{
509
if (null == attribute)
@@ -535,7 +533,6 @@ namespace WixToolset.Core
533
/// <param name="attribute">The attribute containing the value to get.</param>
534
/// <param name="onlyAnsi">Whether to allow Unicode (UCS) or UTF code pages.</param>
535
/// <returns>A valid code page integer value or variable expression.</returns>
538
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
536
public string GetAttributeLocalizableCodePageValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool onlyAnsi = false)
537
{
538
if (null == attribute)
@@ -577,7 +574,6 @@ namespace WixToolset.Core
574
/// <param name="minimum">The minimum legal value.</param>
575
/// <param name="maximum">The maximum legal value.</param>
576
/// <returns>The attribute's integer value or a special value if an error occurred during conversion.</returns>
580
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
577
public int GetAttributeIntegerValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum)
578
{
579
return this.parseHelper.GetAttributeIntegerValue(sourceLineNumbers, attribute, minimum, maximum);
@@ -602,7 +598,6 @@ namespace WixToolset.Core
598
/// <param name="sourceLineNumbers">Source line information about the owner element.</param>
599
/// <param name="attribute">The attribute containing the value to get.</param>
600
/// <returns>Int representation of the date time.</returns>
605
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
601
public int GetAttributeDateTimeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute)
602
{
603
if (null == attribute)
@@ -748,7 +743,6 @@ namespace WixToolset.Core
743
/// <param name="sourceLineNumbers">Source line information about the owner element.</param>
744
/// <param name="attribute">The attribute containing the value to get.</param>
745
/// <returns>The attribute's YesNoDefaultType value.</returns>
751
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
746
public YesNoDefaultType GetAttributeYesNoDefaultValue(SourceLineNumber sourceLineNumbers, XAttribute attribute)
747
{
748
return this.parseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attribute);
@@ -793,7 +787,6 @@ namespace WixToolset.Core
787
/// <param name="allowWildcards">true if wildcards are allowed in the filename.</param>
788
/// <param name="allowRelative">true if relative paths are allowed in the filename.</param>
789
/// <returns>The attribute's long filename value.</returns>
796
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
790
public string GetAttributeLongFilename(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowWildcards = false, bool allowRelative = false)
791
{
792
return this.parseHelper.GetAttributeLongFilename(sourceLineNumbers, attribute, allowWildcards, allowRelative);
@@ -817,7 +810,6 @@ namespace WixToolset.Core
810
/// <param name="attribute">The attribute containing the value to get.</param>
811
/// <param name="allowHkmu">Whether HKMU is returned as -1 (true), or treated as an error (false).</param>
812
/// <returns>The attribute's RegisitryRootType value.</returns>
820
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
813
public RegistryRootType? GetAttributeRegistryRootValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowHkmu)
814
{
815
return this.parseHelper.GetAttributeRegistryRootValue(sourceLineNumbers, attribute, allowHkmu);
@@ -829,7 +821,6 @@ namespace WixToolset.Core
821
/// <param name="sourceLineNumbers">Source line information about the owner element.</param>
822
/// <param name="attribute">The attribute containing the value to get.</param>
823
/// <returns>The attribute's value.</returns>
832
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
824
public string GetAttributeBundleVariableValue(SourceLineNumber sourceLineNumbers, XAttribute attribute)
825
{
826
string value = this.GetAttributeValue(sourceLineNumbers, attribute);
@@ -852,7 +843,6 @@ namespace WixToolset.Core
843
/// <param name="sourceLineNumbers">Source line information about the owner element.</param>
844
/// <param name="attribute">The attribute containing the value to get.</param>
845
/// <returns>The attribute's value.</returns>
855
- [SuppressMessage("Microsoft.Design", "CA1059:MembersShouldNotExposeCertainConcreteTypes")]
846
public string GetAttributeMsiPropertyNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute)
847
{
848
string value = this.GetAttributeValue(sourceLineNumbers, attribute);
@@ -885,7 +875,6 @@ namespace WixToolset.Core
875
/// <param name="prefix">Three letter or less prefix for generated row identifier.</param>
876
/// <param name="args">Information to hash.</param>
877
/// <returns>The generated identifier.</returns>
888
- [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.InvalidOperationException.#ctor(System.String)")]
878
public Identifier CreateIdentifier(string prefix, params string[] args)
879
{
880
return this.parseHelper.CreateIdentifier(prefix, args);
src/WixToolset.Core/Compiler_2.cs
-12
@@ -1523,9 +1523,6 @@ namespace WixToolset.Core
1523
/// <param name="win64Component">true if the component is 64-bit.</param>
1524
/// <param name="possibleKeyPath">Identifier of this registry key since it could be the component's keypath.</param>
1525
/// <returns>Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise.</returns>
1526
- [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " +
1527
- "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " +
1528
- "Furthermore, there is no security hole here, as the strings won't need to make a round trip")]
1526
private YesNoType ParseRegistryKeyElement(XElement node, string componentId, RegistryRootType? root, string parentKey, bool win64Component, out string possibleKeyPath)
1527
{
1528
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -1718,9 +1715,6 @@ namespace WixToolset.Core
1715
/// <param name="win64Component">true if the component is 64-bit.</param>
1716
/// <param name="possibleKeyPath">Identifier of this registry key since it could be the component's keypath.</param>
1717
/// <returns>Yes if this element was marked as the parent component's key path, No if explicitly marked as not being a key path, or NotSet otherwise.</returns>
1721
- [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " +
1722
- "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " +
1723
- "Furthermore, there is no security hole here, as the strings won't need to make a round trip")]
1718
private YesNoType ParseRegistryValueElement(XElement node, string componentId, RegistryRootType? root, string parentKey, bool win64Component, out string possibleKeyPath)
1719
{
1720
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -1994,9 +1988,6 @@ namespace WixToolset.Core
1988
/// </summary>
1989
/// <param name="node">The element to parse.</param>
1990
/// <param name="componentId">The component identifier of the parent element.</param>
1997
- [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " +
1998
- "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " +
1999
- "Furthermore, there is no security hole here, as the strings won't need to make a round trip")]
1991
private void ParseRemoveRegistryKeyElement(XElement node, string componentId)
1992
{
1993
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
@@ -2097,9 +2088,6 @@ namespace WixToolset.Core
2088
/// </summary>
2089
/// <param name="node">The element to parse.</param>
2090
/// <param name="componentId">The component identifier of the parent element.</param>
2100
- [SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Justification = "Changing the way this string normalizes would result " +
2101
- "in a change to the way the Registry table is generated, potentially causing extra churn in patches on an MSI built from an older version of WiX. " +
2102
- "Furthermore, there is no security hole here, as the strings won't need to make a round trip")]
2091
private void ParseRemoveRegistryValueElement(XElement node, string componentId)
2092
{
2093
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
src/WixToolset.Core/Compiler_Patch.cs
-1
@@ -448,7 +448,6 @@ namespace WixToolset.Core
448
/// <param name="node">Element to parse.</param>
449
/// <param name="parentType"></param>
450
/// <param name="parentId"></param>
451
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
451
private void ParsePatchFamilyGroupElement(XElement node, ComplexReferenceParentType parentType, string parentId)
452
{
453
var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);