diff --git a/Enums/ErrorNumber.cs b/Enums/ErrorNumber.cs index 7b8d325..534656a 100644 --- a/Enums/ErrorNumber.cs +++ b/Enums/ErrorNumber.cs @@ -50,7 +50,7 @@ namespace Aaru.CommonTypes.Enums /// Media has been already dumped completely AlreadyDumped = 3, /// Image and its sectors cannot be verified - NotVerificable = 4, + NotVerifiable = 4, /// There are bad sectors and image cannot be verified BadSectorsImageNotVerified = 5, /// All sectors are good and image cannot be verified diff --git a/Enums/Images.cs b/Enums/Images.cs index 90d538e..2460306 100644 --- a/Enums/Images.cs +++ b/Enums/Images.cs @@ -39,6 +39,8 @@ using System; using System.Diagnostics.CodeAnalysis; +// ReSharper disable UnusedMember.Global + namespace Aaru.CommonTypes.Enums { /// Track (as partitioning element) types. @@ -122,7 +124,7 @@ namespace Aaru.CommonTypes.Enums CD_FullTOC = 2, /// CD PMA CD_PMA = 3, - /// CD Adress-Time-In-Pregroove + /// CD Address-Time-In-Pregroove CD_ATIP = 4, /// CD-Text CD_TEXT = 5, @@ -300,7 +302,7 @@ namespace Aaru.CommonTypes.Enums Correct = 0x01, /// Data checksum is incorrect. DataError = 0x02, - /// Addres mark checksum is incorrect. + /// Address mark checksum is incorrect. AddressMarkError = 0x04, /// There is another sector in the same track/head with same sector id. Duplicated = 0x08, @@ -330,13 +332,13 @@ namespace Aaru.CommonTypes.Enums public enum FloppyDensities : byte { - /// Standard coercitivity (about 300Oe as found in 8" and 5.25"-double-density disks). + /// Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks). Standard, - /// Double density coercitivity (about 600Oe as found in 5.25" HD and 3.5" DD disks). + /// Double density coercivity (about 600Oe as found in 5.25" HD and 3.5" DD disks). Double, - /// High density coercitivity (about 700Oe as found in 3.5" HD disks). + /// High density coercivity (about 700Oe as found in 3.5" HD disks). High, - /// Extended density coercitivity (about 750Oe as found in 3.5" ED disks). + /// Extended density coercivity (about 750Oe as found in 3.5" ED disks). Extended } diff --git a/Filters.cs b/Filters.cs index cbdb316..b03d6b3 100644 --- a/Filters.cs +++ b/Filters.cs @@ -46,9 +46,9 @@ using Aaru.Console; namespace Aaru.CommonTypes { - public class FiltersList + public sealed class FiltersList { - public SortedDictionary Filters; + public readonly SortedDictionary Filters; /// Fills the list of all known filters public FiltersList() @@ -110,9 +110,5 @@ namespace Aaru.CommonTypes return null; } } - - /// Gets all known filters - /// Known filters - public SortedDictionary GetFiltersList() => Filters; } } \ No newline at end of file diff --git a/Interfaces/IArchive.cs b/Interfaces/IArchive.cs index a5ffbbd..e0a877d 100644 --- a/Interfaces/IArchive.cs +++ b/Interfaces/IArchive.cs @@ -35,6 +35,8 @@ using System; using System.Collections.Generic; using System.IO; +// ReSharper disable UnusedMember.Global + namespace Aaru.CommonTypes.Interfaces { [Flags] @@ -163,18 +165,18 @@ namespace Aaru.CommonTypes.Interfaces /// Gets the attributes of a file or directory. /// /// Error number. - /// The entry in the archive for which to retreive the attributes. + /// The entry in the archive for which to retrieve the attributes. /// File attributes, or zero if the archive does not support attributes. FileAttributes GetAttributes(int entryNumber); /// Lists all extended attributes, alternate data streams and forks of the given file. - /// The entry in the archive for which to retreive the list of attributes. + /// The entry in the archive for which to retrieve the list of attributes. /// List of extended attributes, alternate data streams and forks. List GetXAttrs(int entryNumber); /// Reads an extended attribute, alternate data stream or fork from the given file. /// Error number. - /// The entry in the archive for which to retreive the XAttr. + /// The entry in the archive for which to retrieve the XAttr. /// Extended attribute, alternate data stream or fork name. /// Buffer with the XAttr data. byte[] GetXattr(int entryNumber, string xattr); diff --git a/Interfaces/IOpticalMediaImage.cs b/Interfaces/IOpticalMediaImage.cs index 3df2084..3667edd 100644 --- a/Interfaces/IOpticalMediaImage.cs +++ b/Interfaces/IOpticalMediaImage.cs @@ -95,12 +95,12 @@ namespace Aaru.CommonTypes.Interfaces byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track); /// Gets the disc track extents for a specified session. - /// The track exents for that session. + /// The track extents for that session. /// Session. List GetSessionTracks(Session session); /// Gets the disc track extents for a specified session. - /// The track exents for that session. + /// The track extents for that session. /// Session. List GetSessionTracks(ushort session); diff --git a/Interfaces/IReadOnlyFilesystem.cs b/Interfaces/IReadOnlyFilesystem.cs index 1a6fcba..1468132 100644 --- a/Interfaces/IReadOnlyFilesystem.cs +++ b/Interfaces/IReadOnlyFilesystem.cs @@ -54,8 +54,8 @@ namespace Aaru.CommonTypes.Interfaces Dictionary Namespaces { get; } /// - /// Initializates whatever internal structures the filesystem plugin needs to be able to read files and - /// directories from the filesystem. + /// Initializes whatever internal structures the filesystem plugin needs to be able to read files and directories + /// from the filesystem. /// /// /// diff --git a/Interfaces/IWritableFloppyImage.cs b/Interfaces/IWritableFloppyImage.cs index a60eff6..5122fab 100644 --- a/Interfaces/IWritableFloppyImage.cs +++ b/Interfaces/IWritableFloppyImage.cs @@ -44,7 +44,7 @@ namespace Aaru.CommonTypes.Interfaces /// /// /// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is - /// needed because floppy formatting characteristics are not necesarily compatible with the whole LBA-oriented + /// needed because floppy formatting characteristics are not necessarily compatible with the whole LBA-oriented /// interface defined by . All data expected by these methods /// is already decoded from its corresponding bitstream. /// diff --git a/Interfaces/IWritableImage.cs b/Interfaces/IWritableImage.cs index 4d4490a..c0063bf 100644 --- a/Interfaces/IWritableImage.cs +++ b/Interfaces/IWritableImage.cs @@ -59,7 +59,7 @@ namespace Aaru.CommonTypes.Interfaces IEnumerable SupportedMediaTypes { get; } /// Retrieves a list of options supported by the filesystem, with name, type and description IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions { get; } - /// Gets a list of known extensions for format auto-chosing + /// Gets a list of known extensions for format auto-choosing IEnumerable KnownExtensions { get; } bool IsWriting { get; } diff --git a/Interop/Version.cs b/Interop/Version.cs index cee18f5..3bd51cd 100644 --- a/Interop/Version.cs +++ b/Interop/Version.cs @@ -46,17 +46,20 @@ namespace Aaru.CommonTypes.Interop { /// Gets version string /// Version - public static string GetVersion() => typeof(Version).Assembly.GetName().Version.ToString(); + public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString(); public static string GetNetCoreVersion() { Assembly assembly = typeof(GCSettings).Assembly; - string[] assemblyPath = assembly.CodeBase.Split(new[] + string[] assemblyPath = assembly.CodeBase?.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries); + if(assemblyPath is null) + return null; + int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App"); if(netCoreAppIndex > 0 && diff --git a/MediaType.cs b/MediaType.cs index fd0c9b9..aa2239e 100644 --- a/MediaType.cs +++ b/MediaType.cs @@ -41,6 +41,9 @@ using System; +// ReSharper disable UnusedMember.Global +// ReSharper disable IdentifierTypo + namespace Aaru.CommonTypes { public enum MediaEncoding diff --git a/MediaTypeFromDevice/FromScsi.cs b/MediaTypeFromDevice/FromScsi.cs index bf7cb86..6b4e776 100644 --- a/MediaTypeFromDevice/FromScsi.cs +++ b/MediaTypeFromDevice/FromScsi.cs @@ -55,7 +55,7 @@ namespace Aaru.CommonTypes { // Direct access device case 0x00: - // Simpilified access device + // Simplified access device case 0x0E: if(mediumType == 0x03 || mediumType == 0x05 || diff --git a/Metadata/Version.cs b/Metadata/Version.cs index 5330006..c28bad0 100644 --- a/Metadata/Version.cs +++ b/Metadata/Version.cs @@ -49,7 +49,7 @@ namespace Aaru.CommonTypes.Metadata { Name = "Aaru", OperatingSystem = DetectOS.GetRealPlatformID().ToString(), - Version = typeof(Version).Assembly.GetName().Version.ToString() + Version = typeof(Version).Assembly.GetName().Version?.ToString() }; } } \ No newline at end of file diff --git a/Structs/Devices/ATA/Identify.cs b/Structs/Devices/ATA/Identify.cs index 643c3c7..007a7b7 100644 --- a/Structs/Devices/ATA/Identify.cs +++ b/Structs/Devices/ATA/Identify.cs @@ -45,6 +45,8 @@ using Aaru.Console; using Aaru.Helpers; using Marshal = Aaru.Helpers.Marshal; +// ReSharper disable UnusedMember.Global + namespace Aaru.CommonTypes.Structs.Devices.ATA { /// @@ -66,7 +68,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA /// ATAPI: Command queueing supported CommandQueue = 0x4000, /// Standby timer values are standard - StandardStanbyTimer = 0x2000, + StandardStandbyTimer = 0x2000, /// ATAPI: Overlap operation supported OverlapOperation = 0x2000, /// ATAPI: ATA software reset required Obsoleted in ATA/ATAPI-4 @@ -234,7 +236,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA FUAWrite = 0x0040, /// General Purpose Logging feature supported GPL = 0x0020, - /// Sstreaming feature set is supported + /// Streaming feature set is supported Streaming = 0x0010, /// Media Card Pass Through command set supported MCPT = 0x0008, @@ -322,7 +324,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA Reserved09 = 0x0200, Reserved08 = 0x0100, Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020, Reserved04 = 0x0010, Reserved03 = 0x0008, Reserved02 = 0x0004, Reserved01 = 0x0002, - /// TRIM is suported + /// TRIM is supported Trim = 0x0001 } @@ -443,7 +445,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA DevSlumbTrans = 0x4000, /// Supports host automatic partial to slumber transitions HostSlumbTrans = 0x2000, - /// Supports NCQ priroty + /// Supports NCQ priority NCQPriority = 0x1000, /// Supports unload while NCQ commands are outstanding UnloadNCQ = 0x0800, diff --git a/Structs/Devices/SCSI/Modes/2A.cs b/Structs/Devices/SCSI/Modes/2A.cs index c806281..72156c5 100644 --- a/Structs/Devices/SCSI/Modes/2A.cs +++ b/Structs/Devices/SCSI/Modes/2A.cs @@ -37,13 +37,13 @@ using Newtonsoft.Json; namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes { - [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"), - SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")] #region Mode Page 0x2A: CD-ROM capabilities page /// /// CD-ROM capabilities page Page code 0x2A 16 bytes in OB-U0077C 20 bytes in SFF-8020i 22 bytes in MMC-1 26 bytes /// in MMC-2 Variable bytes in MMC-3 /// + [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "MemberCanBeInternal"), + SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")] public class ModePage_2A { public ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors; diff --git a/Structs/Images.cs b/Structs/Images.cs index d1aab9b..917198e 100644 --- a/Structs/Images.cs +++ b/Structs/Images.cs @@ -177,8 +177,8 @@ namespace Aaru.CommonTypes.Structs public FloppyTypes Type; /// Bitrate in bits per second used to write the floppy, 0 if unknown or track-variable. public uint Bitrate; - /// Physical magnetic density (coercitivity) of floppy medium. - public FloppyDensities Coercitivity; + /// Physical magnetic density (coercivity) of floppy medium. + public FloppyDensities Coercivity; /// How many physical tracks are actually written in the floppy image. public ushort Tracks; /// How many physical heads are actually written in the floppy image.