Browse Source

Enable CA1859

pull/2583/head
James Jackson-South 3 years ago
parent
commit
9ac4cd91a4
  1. 3
      .gitattributes
  2. 2
      shared-infrastructure
  3. 3
      src/ImageSharp.ruleset
  4. 4
      src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs
  5. 2
      src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs
  6. 2
      src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs

3
.gitattributes

@ -133,3 +133,6 @@
*.pnm filter=lfs diff=lfs merge=lfs -text *.pnm filter=lfs diff=lfs merge=lfs -text
*.wbmp filter=lfs diff=lfs merge=lfs -text *.wbmp filter=lfs diff=lfs merge=lfs -text
*.exr filter=lfs diff=lfs merge=lfs -text *.exr filter=lfs diff=lfs merge=lfs -text
*.ico filter=lfs diff=lfs merge=lfs -text
*.cur filter=lfs diff=lfs merge=lfs -text
*.ani filter=lfs diff=lfs merge=lfs -text

2
shared-infrastructure

@ -1 +1 @@
Subproject commit 4e892950d7f17e5cb64160675d6902545cc3b5c5 Subproject commit 1c526a97eea8bcbc7c79de095676f7fb975a9fb1

3
src/ImageSharp.ruleset

@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="ImageSharp" ToolsVersion="17.0"> <RuleSet Name="ImageSharp" ToolsVersion="17.0">
<Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" /> <Include Path="..\shared-infrastructure\sixlabors.ruleset" Action="Default" />
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp.NetAnalyzers" RuleNamespace="Microsoft.CodeAnalysis.CSharp.NetAnalyzers">
<Rule Id="CA1859" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers"> <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1011" Action="None" /> <Rule Id="SA1011" Action="None" />
</Rules> </Rules>

4
src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegFrame.cs

@ -133,7 +133,7 @@ internal sealed class JpegFrame : IDisposable
for (int i = 0; i < this.ComponentCount; i++) for (int i = 0; i < this.ComponentCount; i++)
{ {
IJpegComponent component = this.Components[i]; JpegComponent component = this.Components[i];
component.Init(maxSubFactorH, maxSubFactorV); component.Init(maxSubFactorH, maxSubFactorV);
} }
} }
@ -143,7 +143,7 @@ internal sealed class JpegFrame : IDisposable
bool fullScan = this.Progressive || !this.Interleaved; bool fullScan = this.Progressive || !this.Interleaved;
for (int i = 0; i < this.ComponentCount; i++) for (int i = 0; i < this.ComponentCount; i++)
{ {
IJpegComponent component = this.Components[i]; JpegComponent component = this.Components[i];
component.AllocateSpectral(fullScan); component.AllocateSpectral(fullScan);
} }
} }

2
src/ImageSharp/Formats/Tiff/Ifd/DirectoryReader.cs

@ -71,7 +71,7 @@ internal class DirectoryReader
throw TiffThrowHelper.ThrowInvalidHeader(); throw TiffThrowHelper.ThrowInvalidHeader();
} }
private IList<ExifProfile> ReadIfds(bool isBigTiff) private List<ExifProfile> ReadIfds(bool isBigTiff)
{ {
List<EntryReader> readers = new(); List<EntryReader> readers = new();
while (this.nextIfdOffset != 0 && this.nextIfdOffset < (ulong)this.stream.Length) while (this.nextIfdOffset != 0 && this.nextIfdOffset < (ulong)this.stream.Length)

2
src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs

@ -472,7 +472,7 @@ internal abstract class BaseExifReader
} }
} }
private void Add(IList<IExifValue> values, IExifValue exif, object? value) private void Add(IList<IExifValue> values, ExifValue exif, object? value)
{ {
if (!exif.TrySetValue(value)) if (!exif.TrySetValue(value))
{ {

Loading…
Cancel
Save