From 86628288e3da5ac30ebe56f97606c9351fcb349f Mon Sep 17 00:00:00 2001 From: Jarred Capellman Date: Tue, 13 Aug 2024 07:00:46 -0500 Subject: [PATCH] Fix: Another round of SonarQube fixes --- src/MLIDS.UnitTests/lib/DAL/JsonFileDAL.cs | 18 ++++++------- src/MLIDS.UnitTests/lib/DAL/LiteDBDAL.cs | 14 +++++------ src/MLIDS.UnitTests/lib/DAL/MongoDAL.cs | 10 ++++---- src/MLIDS.UnitTests/lib/Helpers/DALHelper.cs | 4 +-- src/MLIDS.UnitTests/lib/ML/Trainer.cs | 2 +- .../ViewModels/BaseViewModel.cs | 12 ++++----- src/MLIDS.lib/DAL/CSVFileDAL.cs | 25 ++++++------------- src/MLIDS.lib/DAL/EmptyDAL.cs | 4 +-- src/MLIDS.lib/DAL/JsonFileDAL.cs | 8 +++--- src/MLIDS.lib/DAL/LiteDBDAL.cs | 6 ++--- src/MLIDS.lib/DAL/MongoDAL.cs | 12 ++++----- src/MLIDS.lib/Extensions/CSV.cs | 2 +- src/MLIDS.lib/Helpers/DALHelper.cs | 16 ++++-------- src/MLIDS.lib/Models/LightGBMBinaryRunner.cs | 2 +- src/MLIDS.lib/Models/RandomizedPCARunner.cs | 2 +- src/MLIDS.lib/Objects/MLIDSDevice.cs | 9 ++----- 16 files changed, 62 insertions(+), 84 deletions(-) diff --git a/src/MLIDS.UnitTests/lib/DAL/JsonFileDAL.cs b/src/MLIDS.UnitTests/lib/DAL/JsonFileDAL.cs index e6f0b2d..292034e 100644 --- a/src/MLIDS.UnitTests/lib/DAL/JsonFileDAL.cs +++ b/src/MLIDS.UnitTests/lib/DAL/JsonFileDAL.cs @@ -12,7 +12,7 @@ public class JsonDAL [TestMethod] public async Task JsonDAL_NullTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); var result = await jsonDal.GetHostPacketsAsync(null); @@ -22,7 +22,7 @@ public async Task JsonDAL_NullTestAsync() [TestMethod] public async Task JsonDAL_StringTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); var result = await jsonDal.GetHostPacketsAsync("test"); @@ -33,7 +33,7 @@ public async Task JsonDAL_StringTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task JsonDAL_WriteNullTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); await jsonDal.WritePacketAsync(null); } @@ -42,7 +42,7 @@ public async Task JsonDAL_WriteNullTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task JsonDAL_QueryNullTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); await jsonDal.QueryPacketsAsync(null); } @@ -50,7 +50,7 @@ public async Task JsonDAL_QueryNullTestAsync() [TestMethod] public async Task JsonDAL_QueryEmptyTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); var result = await jsonDal.QueryPacketsAsync(a => a.Label); @@ -60,7 +60,7 @@ public async Task JsonDAL_QueryEmptyTestAsync() [TestMethod] public void JsonDAL_InitializeTest() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); var result = jsonDal.Initialize(); @@ -71,7 +71,7 @@ public void JsonDAL_InitializeTest() [ExpectedException(typeof(ArgumentNullException))] public async Task JSONDAL_NullFileNameTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem()); + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem()); var result = await jsonDal.WritePacketAsync(new MLIDS.lib.ML.Objects.PayloadItem { @@ -98,7 +98,7 @@ public async Task JSONDAL_NullFileNameTestAsync() [TestMethod] public async Task JSONDAL_WriteNotEmptyTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem { DAL_FileName = "Testo.json" }); @@ -130,7 +130,7 @@ public async Task JSONDAL_WriteNotEmptyTestAsync() [TestMethod] public async Task JSONDAL_QueryTestAsync() { - var jsonDal = new MLIDS.lib.DAL.JsonFileDAL(new MLIDS.lib.Containers.SettingsItem + var jsonDal = new MLIDS.lib.DAL.JsonFileDal(new MLIDS.lib.Containers.SettingsItem { DAL_FileName = "Testo.json" }); diff --git a/src/MLIDS.UnitTests/lib/DAL/LiteDBDAL.cs b/src/MLIDS.UnitTests/lib/DAL/LiteDBDAL.cs index 59aeed8..66249cd 100644 --- a/src/MLIDS.UnitTests/lib/DAL/LiteDBDAL.cs +++ b/src/MLIDS.UnitTests/lib/DAL/LiteDBDAL.cs @@ -13,14 +13,14 @@ public class LiteDBDAL [ExpectedException(typeof(ArgumentNullException))] public void LiteDBDAL_NullTest() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(null); + var litedb = new MLIDS.lib.DAL.LiteDbdal(null); } [TestMethod] [ExpectedException(typeof(ArgumentNullException))] public async Task LiteDBDAL_StringTestAsync() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem()); + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem()); await litedb.GetHostPacketsAsync("test"); } @@ -29,7 +29,7 @@ public async Task LiteDBDAL_StringTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task LiteDBDAL_WriteNullTestAsync() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem()); + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem()); await litedb.WritePacketAsync(null); } @@ -37,7 +37,7 @@ public async Task LiteDBDAL_WriteNullTestAsync() [TestMethod] public async Task LiteDBDAL_WriteEmptyTestAsync() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem { DAL_FileName = "testo.db" }); @@ -55,7 +55,7 @@ public async Task LiteDBDAL_WriteEmptyTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task LiteDBDAL_QueryNullTestAsync() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem()); + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem()); await litedb.QueryPacketsAsync(null); } @@ -64,7 +64,7 @@ public async Task LiteDBDAL_QueryNullTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task LiteDBDAL_QueryEmptyTestAsync() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem()); + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem()); var result = await litedb.QueryPacketsAsync(a => a.Label); @@ -74,7 +74,7 @@ public async Task LiteDBDAL_QueryEmptyTestAsync() [TestMethod] public void LiteDBDAL_Initialize() { - var litedb = new MLIDS.lib.DAL.LiteDBDAL(new MLIDS.lib.Containers.SettingsItem()); + var litedb = new MLIDS.lib.DAL.LiteDbdal(new MLIDS.lib.Containers.SettingsItem()); var result = litedb.Initialize(); diff --git a/src/MLIDS.UnitTests/lib/DAL/MongoDAL.cs b/src/MLIDS.UnitTests/lib/DAL/MongoDAL.cs index 1112f53..28b8601 100644 --- a/src/MLIDS.UnitTests/lib/DAL/MongoDAL.cs +++ b/src/MLIDS.UnitTests/lib/DAL/MongoDAL.cs @@ -13,7 +13,7 @@ public class MongoDAL [TestMethod] public async Task MongoDAL_NullTestAsync() { - var mongo = new MLIDS.lib.DAL.MongoDAL(new MLIDS.lib.Containers.SettingsItem()); + var mongo = new MLIDS.lib.DAL.MongoDal(new MLIDS.lib.Containers.SettingsItem()); mongo.Initialize(); @@ -25,7 +25,7 @@ public async Task MongoDAL_NullTestAsync() [TestMethod] public async Task MongoDAL_StringTestAsync() { - var mongo = new MLIDS.lib.DAL.MongoDAL(new MLIDS.lib.Containers.SettingsItem()); + var mongo = new MLIDS.lib.DAL.MongoDal(new MLIDS.lib.Containers.SettingsItem()); mongo.Initialize(); @@ -38,7 +38,7 @@ public async Task MongoDAL_StringTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task MongoDAL_WriteNullTestAsync() { - var mongo = new MLIDS.lib.DAL.MongoDAL(new MLIDS.lib.Containers.SettingsItem()); + var mongo = new MLIDS.lib.DAL.MongoDal(new MLIDS.lib.Containers.SettingsItem()); await mongo.WritePacketAsync(null); } @@ -47,7 +47,7 @@ public async Task MongoDAL_WriteNullTestAsync() [ExpectedException(typeof(ArgumentNullException))] public async Task MongoDAL_QueryNullTestAsync() { - var mongo = new MLIDS.lib.DAL.MongoDAL(new MLIDS.lib.Containers.SettingsItem()); + var mongo = new MLIDS.lib.DAL.MongoDal(new MLIDS.lib.Containers.SettingsItem()); await mongo.QueryPacketsAsync(null); } @@ -55,7 +55,7 @@ public async Task MongoDAL_QueryNullTestAsync() [TestMethod] public async Task MongoDAL_QueryEmptyTestAsync() { - var mongo = new MLIDS.lib.DAL.MongoDAL(new MLIDS.lib.Containers.SettingsItem()); + var mongo = new MLIDS.lib.DAL.MongoDal(new MLIDS.lib.Containers.SettingsItem()); mongo.Initialize(); diff --git a/src/MLIDS.UnitTests/lib/Helpers/DALHelper.cs b/src/MLIDS.UnitTests/lib/Helpers/DALHelper.cs index dc53051..c93a429 100644 --- a/src/MLIDS.UnitTests/lib/Helpers/DALHelper.cs +++ b/src/MLIDS.UnitTests/lib/Helpers/DALHelper.cs @@ -11,13 +11,13 @@ public class DALHelper [ExpectedException(typeof(ArgumentNullException))] public void DALHelperTests_NullSettings() { - _ = MLIDS.lib.Helpers.DALHelper.GetAvailableDALs(null); + _ = MLIDS.lib.Helpers.DalHelper.GetAvailableDALs(null); } [TestMethod] public void DALHelperTests_EmptySettings() { - var result = MLIDS.lib.Helpers.DALHelper.GetAvailableDALs(new MLIDS.lib.Containers.SettingsItem()); + var result = MLIDS.lib.Helpers.DalHelper.GetAvailableDALs(new MLIDS.lib.Containers.SettingsItem()); Assert.IsTrue(result.Count == 5); } diff --git a/src/MLIDS.UnitTests/lib/ML/Trainer.cs b/src/MLIDS.UnitTests/lib/ML/Trainer.cs index 493ea47..ca540bb 100644 --- a/src/MLIDS.UnitTests/lib/ML/Trainer.cs +++ b/src/MLIDS.UnitTests/lib/ML/Trainer.cs @@ -22,7 +22,7 @@ public async Task Trainer_NullTest() [ExpectedException(typeof(FileNotFoundException))] public async Task Trainer_ModelNotFoundTest() { - await new MLIDS.lib.ML.Trainer().GenerateModel(new MongoDAL(new MLIDS.lib.Containers.SettingsItem()), "test"); + await new MLIDS.lib.ML.Trainer().GenerateModel(new MongoDal(new MLIDS.lib.Containers.SettingsItem()), "test"); } } } \ No newline at end of file diff --git a/src/MLIDS.lib.Windows/ViewModels/BaseViewModel.cs b/src/MLIDS.lib.Windows/ViewModels/BaseViewModel.cs index 2b41b85..00d0d7e 100644 --- a/src/MLIDS.lib.Windows/ViewModels/BaseViewModel.cs +++ b/src/MLIDS.lib.Windows/ViewModels/BaseViewModel.cs @@ -105,9 +105,9 @@ public bool StopBtnEnabled } } - private List _deviceList = new(); + private List _deviceList = new(); - public List DeviceList + public List DeviceList { get => _deviceList; @@ -119,9 +119,9 @@ public List DeviceList } } - private MLIDSDevice _selectedDevice; + private MlidsDevice _selectedDevice; - public MLIDSDevice SelectedDevice + public MlidsDevice SelectedDevice { get => _selectedDevice; @@ -179,7 +179,7 @@ public string SettingsJSON protected BaseViewModel() { - DeviceList = CaptureDeviceList.Instance.Where(a => a is PcapDevice).OrderBy(a => a.Description).Select(b => new MLIDSDevice(b)).ToList(); + DeviceList = CaptureDeviceList.Instance.Where(a => a is PcapDevice).OrderBy(a => a.Description).Select(b => new MlidsDevice(b)).ToList(); SelectedDevice = DeviceList.FirstOrDefault(); @@ -192,7 +192,7 @@ protected BaseViewModel() SettingsJSON = JsonSerializer.Serialize(Settings); - DataLayers = DALHelper.GetAvailableDALs(Settings); + DataLayers = DalHelper.GetAvailableDALs(Settings); SelectedDataLayer = DataLayers.First(a => !a.IsSelectable); } diff --git a/src/MLIDS.lib/DAL/CSVFileDAL.cs b/src/MLIDS.lib/DAL/CSVFileDAL.cs index a9050bf..5a3a038 100644 --- a/src/MLIDS.lib/DAL/CSVFileDAL.cs +++ b/src/MLIDS.lib/DAL/CSVFileDAL.cs @@ -13,16 +13,11 @@ namespace MLIDS.lib.DAL { - public class CsvFileDal : BaseDal + public class CsvFileDal(SettingsItem settingsItem) : BaseDal(settingsItem) { - public class CSVWriter + public class CsvWriter(string filePath) { - private string Filepath { get; set; } - - public CSVWriter(string filePath) - { - Filepath = filePath; - } + private string Filepath { get; set; } = filePath; public async Task WriteToFileAsync(string text) { @@ -33,7 +28,7 @@ public async Task WriteToFileAsync(string text) } } - private CSVWriter _writer; + private CsvWriter _writer; private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); @@ -41,11 +36,7 @@ public async Task WriteToFileAsync(string text) private string _fileName; - public CsvFileDal(SettingsItem settingsItem) : base(settingsItem) - { - } - - public override string Description => "CSV"; + public override string Description => "Csv"; public override bool IsSelectable => true; @@ -82,7 +73,7 @@ public override bool Initialize() { _fileName = settingsItem.DAL_FileName ?? DEFAULT_CSV_FILE; - _writer = new CSVWriter(_fileName); + _writer = new CsvWriter(_fileName); return File.Exists(_fileName); } @@ -98,7 +89,7 @@ public override async Task> QueryPacketsAsync(Expression(); + return []; } var lines = await File.ReadAllLinesAsync(_fileName); @@ -110,7 +101,7 @@ public override async Task> QueryPacketsAsync(Expression()); } - return data.AsQueryable().Where(queryExpression).ToList(); + return [.. data.AsQueryable().Where(queryExpression)]; } public override async Task WritePacketAsync(PayloadItem packet) diff --git a/src/MLIDS.lib/DAL/EmptyDAL.cs b/src/MLIDS.lib/DAL/EmptyDAL.cs index 9000a88..35a4e2c 100644 --- a/src/MLIDS.lib/DAL/EmptyDAL.cs +++ b/src/MLIDS.lib/DAL/EmptyDAL.cs @@ -9,13 +9,13 @@ namespace MLIDS.lib.DAL { - public class EmptyDAL : BaseDal + public class EmptyDal : BaseDal { public override string Description => "--Select a Data Layer--"; public override bool IsSelectable => false; - public EmptyDAL(SettingsItem settings) : base(settings) { } + public EmptyDal(SettingsItem settings) : base(settings) { } public override Task> GetHostPacketsAsync(string hostName) { diff --git a/src/MLIDS.lib/DAL/JsonFileDAL.cs b/src/MLIDS.lib/DAL/JsonFileDAL.cs index 565bdd6..fa6e30f 100644 --- a/src/MLIDS.lib/DAL/JsonFileDAL.cs +++ b/src/MLIDS.lib/DAL/JsonFileDAL.cs @@ -12,7 +12,7 @@ namespace MLIDS.lib.DAL { - public class JsonFileDAL : BaseDal + public class JsonFileDal : BaseDal { private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); @@ -22,7 +22,7 @@ public class JsonFileDAL : BaseDal public override string Description => "JSON"; - public JsonFileDAL(SettingsItem settings) : base(settings) { } + public JsonFileDal(SettingsItem settings) : base(settings) { } public override bool IsSelectable => true; @@ -44,7 +44,7 @@ public override async Task> QueryPacketsAsync(Expression WritePacketAsync(PayloadItem packet) { if (packet == null) { - Log.Error($"JsonFileDAL::WritePacketAsync - packet was null"); + Log.Error($"JsonFileDal::WritePacketAsync - packet was null"); throw new ArgumentNullException(nameof(packet)); } diff --git a/src/MLIDS.lib/DAL/LiteDBDAL.cs b/src/MLIDS.lib/DAL/LiteDBDAL.cs index 6ebc013..c5ab661 100644 --- a/src/MLIDS.lib/DAL/LiteDBDAL.cs +++ b/src/MLIDS.lib/DAL/LiteDBDAL.cs @@ -12,7 +12,7 @@ namespace MLIDS.lib.DAL { - public class LiteDBDAL : BaseDal + public class LiteDbdal : BaseDal { private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); @@ -22,7 +22,7 @@ public class LiteDBDAL : BaseDal public override bool IsSelectable => true; - public LiteDBDAL(SettingsItem settings) : base(settings) { } + public LiteDbdal(SettingsItem settings) : base(settings) { } public override Task> GetHostPacketsAsync(string hostName) => Task.Run(() => @@ -73,7 +73,7 @@ public override bool Initialize() return true; } catch (Exception ex) { - Log.Error("LiteDBDAL::Initialize - Exception when loading: {ex}", ex); + Log.Error($"LiteDBDAL::Initialize - Exception when loading: {ex}", ex); return false; } diff --git a/src/MLIDS.lib/DAL/MongoDAL.cs b/src/MLIDS.lib/DAL/MongoDAL.cs index 9ed1c9b..2f8b955 100644 --- a/src/MLIDS.lib/DAL/MongoDAL.cs +++ b/src/MLIDS.lib/DAL/MongoDAL.cs @@ -10,7 +10,7 @@ namespace MLIDS.lib.DAL { - public class MongoDAL : BaseDal + public class MongoDal(SettingsItem settings) : BaseDal(settings) { private static readonly NLog.Logger Log = NLog.LogManager.GetCurrentClassLogger(); @@ -22,8 +22,6 @@ public class MongoDAL : BaseDal public override bool IsSelectable => true; - public MongoDAL(SettingsItem settings) : base(settings) { } - public override bool Initialize() { try @@ -37,13 +35,13 @@ public override bool Initialize() _db = client.GetDatabase(COLLECTION_NAME); - Log.Debug($"MongoDAL::Initialize - Database Loaded ({settingsItem.DAL_HostIP}:{settingsItem.DAL_HostPort})"); + Log.Debug($"MongoDal::Initialize - Database Loaded ({settingsItem.DAL_HostIP}:{settingsItem.DAL_HostPort})"); return true; } catch (Exception ex) { - Log.Error($"MongoDAL::Initialize - Failed to connect due to: {ex}"); + Log.Error($"MongoDal::Initialize - Failed to connect due to: {ex}"); return false; } @@ -60,7 +58,7 @@ public override async Task> QueryPacketsAsync(System.Linq.Expr { if (queryExpression == null) { - Log.Error($"MongoDAL::QueryPacketsAsync - Query Expression was null"); + Log.Error($"MongoDal::QueryPacketsAsync - Query Expression was null"); throw new ArgumentNullException(nameof(queryExpression)); } @@ -74,7 +72,7 @@ public override async Task WritePacketAsync(PayloadItem packet) { if (packet == null) { - Log.Error($"MongoDAL::WritePacketAsync - packet was null"); + Log.Error($"MongoDal::WritePacketAsync - packet was null"); throw new ArgumentNullException(nameof(packet)); } diff --git a/src/MLIDS.lib/Extensions/CSV.cs b/src/MLIDS.lib/Extensions/CSV.cs index 837fbd1..b0fa58e 100644 --- a/src/MLIDS.lib/Extensions/CSV.cs +++ b/src/MLIDS.lib/Extensions/CSV.cs @@ -3,7 +3,7 @@ namespace MLIDS.lib.Extensions { - public static class CSV + public static class Csv { private const char SEPARATOR = ','; diff --git a/src/MLIDS.lib/Helpers/DALHelper.cs b/src/MLIDS.lib/Helpers/DALHelper.cs index 51e76a5..fc45b90 100644 --- a/src/MLIDS.lib/Helpers/DALHelper.cs +++ b/src/MLIDS.lib/Helpers/DALHelper.cs @@ -7,19 +7,13 @@ namespace MLIDS.lib.Helpers { - public static class DALHelper + public static class DalHelper { - public static List GetAvailableDALs(SettingsItem settings) - { - if (settings == null) - { - throw new ArgumentNullException(nameof(settings)); - } - - return typeof(DALHelper).Assembly.GetTypes().Where(a => typeof(BaseDal) == + public static List GetAvailableDALs(SettingsItem settings) => settings == null + ? throw new ArgumentNullException(nameof(settings)) + : ([.. typeof(DalHelper).Assembly.GetTypes().Where(a => typeof(BaseDal) == a.BaseType && !a.IsAbstract).Select(b => (BaseDal)Activator.CreateInstance(b, settings)).OrderByDescending(c => - !c.IsSelectable).ThenBy(d => d.Description).ToList(); - } + !c.IsSelectable).ThenBy(d => d.Description)]); } } \ No newline at end of file diff --git a/src/MLIDS.lib/Models/LightGBMBinaryRunner.cs b/src/MLIDS.lib/Models/LightGBMBinaryRunner.cs index 34ccd2e..249924e 100644 --- a/src/MLIDS.lib/Models/LightGBMBinaryRunner.cs +++ b/src/MLIDS.lib/Models/LightGBMBinaryRunner.cs @@ -4,7 +4,7 @@ namespace MLIDS.lib.Models { - public class LightGBMBinaryRunner : BaseModelRunner + public class LightGbmBinaryRunner : BaseModelRunner { public override string ModelTypeName => "LightGBM (Binary)"; diff --git a/src/MLIDS.lib/Models/RandomizedPCARunner.cs b/src/MLIDS.lib/Models/RandomizedPCARunner.cs index 91a5fb0..ff70d74 100644 --- a/src/MLIDS.lib/Models/RandomizedPCARunner.cs +++ b/src/MLIDS.lib/Models/RandomizedPCARunner.cs @@ -6,7 +6,7 @@ namespace MLIDS.lib.Models { - public class RandomizedPCARunner : BaseModelRunner + public class RandomizedPcaRunner : BaseModelRunner { public override string ModelTypeName => "Randomized PCA"; diff --git a/src/MLIDS.lib/Objects/MLIDSDevice.cs b/src/MLIDS.lib/Objects/MLIDSDevice.cs index b2632d0..8b343ec 100644 --- a/src/MLIDS.lib/Objects/MLIDSDevice.cs +++ b/src/MLIDS.lib/Objects/MLIDSDevice.cs @@ -5,14 +5,9 @@ namespace MLIDS.lib.Objects { - public class MLIDSDevice + public class MlidsDevice(ICaptureDevice captureDevice) { - private readonly PcapDevice CaptureDevice; - - public MLIDSDevice(ICaptureDevice captureDevice) - { - CaptureDevice = (PcapDevice)captureDevice; - } + private readonly PcapDevice CaptureDevice = (PcapDevice)captureDevice; public delegate void PacketArrivalHandler(object sender, PacketCapture e); public event PacketArrivalHandler OnPacketArrival;