diff --git a/Delegates.cs b/Delegates.cs index 50eb68f..f648a13 100644 --- a/Delegates.cs +++ b/Delegates.cs @@ -30,6 +30,8 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +// ReSharper disable UnusedType.Global + namespace Aaru.CommonTypes; /// Initializes a progress indicator (e.g. makes a progress bar visible) diff --git a/Enums/Nes.cs b/Enums/Nes.cs index 2f95717..1f602b0 100644 --- a/Enums/Nes.cs +++ b/Enums/Nes.cs @@ -1,5 +1,7 @@ // ReSharper disable InconsistentNaming +using System.Diagnostics.CodeAnalysis; + namespace Aaru.CommonTypes.Enums; public enum NesConsoleType : byte @@ -10,6 +12,7 @@ public enum NesConsoleType : byte Extended = 3 } +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum NesTimingMode : byte { RP2C02 = 0, @@ -18,6 +21,7 @@ public enum NesTimingMode : byte UMC6527P = 3 } +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum NesVsPpuType : byte { RP2C03B = 0, @@ -35,6 +39,7 @@ public enum NesVsPpuType : byte RC2C05_05 = 12 } +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum NesVsHardwareType : byte { Normal = 0, @@ -46,6 +51,7 @@ public enum NesVsHardwareType : byte RaidOnBungeling = 6 } +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum NesExtendedConsoleType : byte { Normal = 0, @@ -62,6 +68,7 @@ public enum NesExtendedConsoleType : byte UM6578 = 11 } +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum NesDefaultExpansionDevice : byte { Unspecified = 0, diff --git a/Extents/ExtentsByte.cs b/Extents/ExtentsByte.cs index bc3421f..b7f5a5a 100644 --- a/Extents/ExtentsByte.cs +++ b/Extents/ExtentsByte.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsByte +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsByte { List> _backend; diff --git a/Extents/ExtentsInt.cs b/Extents/ExtentsInt.cs index 561afda..0b8275e 100644 --- a/Extents/ExtentsInt.cs +++ b/Extents/ExtentsInt.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsInt +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsInt { List> _backend; diff --git a/Extents/ExtentsLong.cs b/Extents/ExtentsLong.cs index 63fc78f..f5d1255 100644 --- a/Extents/ExtentsLong.cs +++ b/Extents/ExtentsLong.cs @@ -38,12 +38,15 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsLong +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsLong { List> _backend; diff --git a/Extents/ExtentsSByte.cs b/Extents/ExtentsSByte.cs index ac08273..c5133fb 100644 --- a/Extents/ExtentsSByte.cs +++ b/Extents/ExtentsSByte.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsSByte +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsSByte { List> _backend; diff --git a/Extents/ExtentsShort.cs b/Extents/ExtentsShort.cs index 15fc4a5..69ea3bc 100644 --- a/Extents/ExtentsShort.cs +++ b/Extents/ExtentsShort.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsShort +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsShort { List> _backend; diff --git a/Extents/ExtentsUInt.cs b/Extents/ExtentsUInt.cs index 2b9dd23..e6ffa63 100644 --- a/Extents/ExtentsUInt.cs +++ b/Extents/ExtentsUInt.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsUInt +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsUInt { List> _backend; diff --git a/Extents/ExtentsULong.cs b/Extents/ExtentsULong.cs index c32b218..45374be 100644 --- a/Extents/ExtentsULong.cs +++ b/Extents/ExtentsULong.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsULong +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +public sealed class ExtentsULong { List> _backend; diff --git a/Extents/ExtentsUShort.cs b/Extents/ExtentsUShort.cs index 6e347ac..e96143a 100644 --- a/Extents/ExtentsUShort.cs +++ b/Extents/ExtentsUShort.cs @@ -38,12 +38,16 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; namespace Aaru.CommonTypes.Extents; /// Implements extents for -public class ExtentsUShort +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsUShort { List> _backend; diff --git a/Interfaces/IByteAddressableImage.cs b/Interfaces/IByteAddressableImage.cs index 603fffb..69df140 100644 --- a/Interfaces/IByteAddressableImage.cs +++ b/Interfaces/IByteAddressableImage.cs @@ -37,6 +37,7 @@ // ****************************************************************************/ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Structs; @@ -44,6 +45,11 @@ namespace Aaru.CommonTypes.Interfaces; /// /// Interface defining linear media (chips, game carts, etc) images +[SuppressMessage("ReSharper", "UnusedParameter.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")] public interface IByteAddressableImage : IBaseWritableImage { /// Gets or sets the current position diff --git a/Interfaces/IFilter.cs b/Interfaces/IFilter.cs index 00d9c0c..03f591b 100644 --- a/Interfaces/IFilter.cs +++ b/Interfaces/IFilter.cs @@ -37,6 +37,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using Aaru.CommonTypes.Enums; @@ -46,6 +47,9 @@ namespace Aaru.CommonTypes.Interfaces; /// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g. /// GZIP), or a container (e.g. AppleDouble) /// +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IFilter { /// Descriptive name of the plugin diff --git a/Interfaces/IFloppyImage.cs b/Interfaces/IFloppyImage.cs index ac42255..38feff5 100644 --- a/Interfaces/IFloppyImage.cs +++ b/Interfaces/IFloppyImage.cs @@ -36,6 +36,7 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Structs; @@ -48,6 +49,7 @@ namespace Aaru.CommonTypes.Interfaces; /// interface is defined by . All data returned by these /// methods is already decoded from its corresponding bitstream. /// +[SuppressMessage("ReSharper", "UnusedMember.Global")] public interface IFloppyImage : IMediaImage { /// diff --git a/Interfaces/IFluxImage.cs b/Interfaces/IFluxImage.cs index be9d5b7..7a39565 100644 --- a/Interfaces/IFluxImage.cs +++ b/Interfaces/IFluxImage.cs @@ -36,12 +36,15 @@ // Copyright © 2011-2023 Rebecca Wallander // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; namespace Aaru.CommonTypes.Interfaces; /// /// Abstract class to implement flux reading plugins. +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IFluxImage : IBaseImage { /// diff --git a/Interfaces/IMediaGraph.cs b/Interfaces/IMediaGraph.cs index d0841f8..bfd131d 100644 --- a/Interfaces/IMediaGraph.cs +++ b/Interfaces/IMediaGraph.cs @@ -33,11 +33,14 @@ // ****************************************************************************/ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; namespace Aaru.CommonTypes.Interfaces; /// Defines the interface to draw the dump or verification status of a media in a picture. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IMediaGraph { /// Paints the specified sector in green diff --git a/Interfaces/IOpticalMediaImage.cs b/Interfaces/IOpticalMediaImage.cs index 6cb2430..f4db0fe 100644 --- a/Interfaces/IOpticalMediaImage.cs +++ b/Interfaces/IOpticalMediaImage.cs @@ -37,6 +37,7 @@ // ****************************************************************************/ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Structs; @@ -44,6 +45,9 @@ namespace Aaru.CommonTypes.Interfaces; /// /// Abstract class to implement disk image reading plugins. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage { /// Gets the disc track extents (start, length). diff --git a/Interfaces/IPluginRegister.cs b/Interfaces/IPluginRegister.cs index 3e2c4e1..1c28ce8 100644 --- a/Interfaces/IPluginRegister.cs +++ b/Interfaces/IPluginRegister.cs @@ -38,10 +38,12 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace Aaru.CommonTypes.Interfaces; /// Defines a register of all known plugins +[SuppressMessage("ReSharper", "UnusedMember.Global")] public interface IPluginRegister { /// Gets all checksum plugins diff --git a/Interfaces/IReadOnlyFilesystem.cs b/Interfaces/IReadOnlyFilesystem.cs index 5b171bb..8dea586 100644 --- a/Interfaces/IReadOnlyFilesystem.cs +++ b/Interfaces/IReadOnlyFilesystem.cs @@ -39,6 +39,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text; using Aaru.CommonTypes.AaruMetadata; @@ -51,6 +52,9 @@ namespace Aaru.CommonTypes.Interfaces; /// /// Defines the interface to implement reading the contents of a filesystem +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IReadOnlyFilesystem : IFilesystem { /// Information about the filesystem as expected by Aaru Metadata @@ -179,6 +183,7 @@ public interface IReadOnlyFilesystem : IFilesystem } /// Represents an opened file from a filesystem +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IFileNode { /// Path to the file @@ -192,6 +197,7 @@ public interface IFileNode } /// Represents an opened directory from a filesystem +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] public interface IDirNode { /// Path to the directory diff --git a/Interfaces/IVerifiableSectorsImage.cs b/Interfaces/IVerifiableSectorsImage.cs index f13cad6..0805e39 100644 --- a/Interfaces/IVerifiableSectorsImage.cs +++ b/Interfaces/IVerifiableSectorsImage.cs @@ -38,10 +38,13 @@ // ****************************************************************************/ using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace Aaru.CommonTypes.Interfaces; /// Defines an image that can verify the integrity of the sectors it contains +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public interface IVerifiableSectorsImage { /// Verifies a sector. diff --git a/Interfaces/IWritableFloppyImage.cs b/Interfaces/IWritableFloppyImage.cs index 8ef83bf..952eaca 100644 --- a/Interfaces/IWritableFloppyImage.cs +++ b/Interfaces/IWritableFloppyImage.cs @@ -36,6 +36,7 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Structs; @@ -48,6 +49,7 @@ namespace Aaru.CommonTypes.Interfaces; /// interface defined by . All data expected by these methods /// is already decoded from its corresponding bitstream. /// +[SuppressMessage("ReSharper", "UnusedMember.Global")] public interface IWritableFloppyImage : IFloppyImage, IWritableImage { /// diff --git a/Interfaces/IWritableFluxImage.cs b/Interfaces/IWritableFluxImage.cs index c7fe181..61c5060 100644 --- a/Interfaces/IWritableFluxImage.cs +++ b/Interfaces/IWritableFluxImage.cs @@ -36,12 +36,16 @@ // Copyright © 2011-2023 Rebecca Wallander // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Enums; namespace Aaru.CommonTypes.Interfaces; /// /// Abstract class to implement flux writing plugins. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedParameter.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public interface IWritableFluxImage : IFluxImage, IWritableImage { /// Writes a flux capture. diff --git a/Interfaces/IWritableTapeImage.cs b/Interfaces/IWritableTapeImage.cs index 96a422e..f8ae43a 100644 --- a/Interfaces/IWritableTapeImage.cs +++ b/Interfaces/IWritableTapeImage.cs @@ -37,12 +37,14 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; using Aaru.CommonTypes.Structs; namespace Aaru.CommonTypes.Interfaces; /// /// Defines an image that is writable and can store information about a streaming, digital, tape +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public interface IWritableTapeImage : ITapeImage, IWritableImage { /// Registers a new file in the image diff --git a/Interop/DetectOS.cs b/Interop/DetectOS.cs index d05115a..24e52cd 100644 --- a/Interop/DetectOS.cs +++ b/Interop/DetectOS.cs @@ -50,22 +50,13 @@ public static class DetectOS /// Are we running under Mono? public static readonly bool IsMono = RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal); - /// Are we running under .NET Framework? - public static readonly bool IsNetFramework = - RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal); /// Are we running under .NET Core? public static readonly bool IsNetCore = RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal); - /// Are we running under .NET Native? - public static readonly bool IsNetNative = - RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal); /// Checks if the underlying runtime runs in 64-bit mode public static readonly bool Is64Bit = IntPtr.Size == 8; - /// Checks if the underlying runtime runs in 32-bit mode - public static readonly bool Is32Bit = IntPtr.Size == 4; - /// Are we running under Windows? public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT || GetRealPlatformID() == PlatformID.Win32S || diff --git a/MediaTypeFromDevice/FromScsi.cs b/MediaTypeFromDevice/FromScsi.cs index 9c43a87..d348705 100644 --- a/MediaTypeFromDevice/FromScsi.cs +++ b/MediaTypeFromDevice/FromScsi.cs @@ -68,7 +68,7 @@ public static partial class MediaTypeFromDevice // Sequential access device case 0x01: - return GetFromSsc(scsiPeripheralType, vendor, model, mediumType, densityCode, blocks, blockSize); + return GetFromSsc(vendor, model, mediumType, densityCode); // Write-once device case 0x04: diff --git a/MediaTypeFromDevice/FromSsc.cs b/MediaTypeFromDevice/FromSsc.cs index 5b99041..ad361a1 100644 --- a/MediaTypeFromDevice/FromSsc.cs +++ b/MediaTypeFromDevice/FromSsc.cs @@ -40,16 +40,12 @@ namespace Aaru.CommonTypes; public static partial class MediaTypeFromDevice { /// Gets the media type from an SCSI Streaming Commands compliant device - /// Peripheral type /// Vendor string /// Model string /// Medium type from MODE SENSE /// Density code from MODE SENSE - /// Number of blocks in media - /// Size of a block in bytes /// Media type - public static MediaType GetFromSsc(byte scsiPeripheralType, string vendor, string model, byte mediumType, - byte densityCode, ulong blocks, uint blockSize) + public static MediaType GetFromSsc(string vendor, string model, byte mediumType, byte densityCode) { switch(mediumType) { diff --git a/Structs/Devices/SCSI/Enums.cs b/Structs/Devices/SCSI/Enums.cs index 52ce1b3..5ed7356 100644 --- a/Structs/Devices/SCSI/Enums.cs +++ b/Structs/Devices/SCSI/Enums.cs @@ -35,6 +35,7 @@ using System.Diagnostics.CodeAnalysis; namespace Aaru.CommonTypes.Structs.Devices.SCSI; /// List of known SCSI peripheral qualifiers +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum PeripheralQualifiers : byte { /// Peripheral qualifier: Device is connected and supported diff --git a/Structs/Devices/SCSI/Inquiry.cs b/Structs/Devices/SCSI/Inquiry.cs index db55fba..9a9ee87 100644 --- a/Structs/Devices/SCSI/Inquiry.cs +++ b/Structs/Devices/SCSI/Inquiry.cs @@ -50,6 +50,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI; [SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "MemberCanBeInternal")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public struct Inquiry { const string MODULE_NAME = "SCSI INQUIRY decoder"; diff --git a/Structs/Devices/SCSI/Modes/2A.cs b/Structs/Devices/SCSI/Modes/2A.cs index ebf576f..0e4e30c 100644 --- a/Structs/Devices/SCSI/Modes/2A.cs +++ b/Structs/Devices/SCSI/Modes/2A.cs @@ -47,6 +47,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes; [SuppressMessage("ReSharper", "MemberCanBeInternal")] [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] [SuppressMessage("ReSharper", "NotAccessedField.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public class ModePage_2A { /// Write speed performance descriptors @@ -214,6 +215,7 @@ public class ModePage_2A /// Database ID [JsonIgnore] [Key] + // ReSharper disable once UnusedMember.Global public int Id { get; set; } /// Decodes the page 2Ah of a MODE SENSE response diff --git a/Structs/Filesystems.cs b/Structs/Filesystems.cs index 9f9f08c..6c82903 100644 --- a/Structs/Filesystems.cs +++ b/Structs/Filesystems.cs @@ -38,6 +38,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text.Json.Serialization; @@ -45,6 +46,7 @@ namespace Aaru.CommonTypes.Structs; /// File attributes. [Flags] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public enum FileAttributes : ulong { /// File has no attributes @@ -241,6 +243,7 @@ public class FileEntryInfo } /// Information about a volume +[SuppressMessage("ReSharper", "NotAccessedField.Global")] public class FileSystemInfo { /// Blocks for this filesystem diff --git a/Structs/Images.cs b/Structs/Images.cs index 63704d0..b380dd4 100644 --- a/Structs/Images.cs +++ b/Structs/Images.cs @@ -173,6 +173,7 @@ public class Track } /// Floppy physical characteristics structure. +[SuppressMessage("ReSharper", "UnusedMember.Global")] public struct FloppyInfo { /// Physical floppy type.