From 860e7c3e1e73f3bb2bd9c731127a6893e61dae65 Mon Sep 17 00:00:00 2001 From: Alexandr Morogov <42555001+krankenbro@users.noreply.github.com> Date: Thu, 19 Aug 2021 12:01:21 +0200 Subject: [PATCH] VCI-128: Fix codesmells (#16) --- PlatformTools/AppSettings.cs | 2 +- PlatformTools/Build.PackageManager.cs | 1 + PlatformTools/ExtModuleCatalog.cs | 2 +- PlatformTools/GithubManager.cs | 2 +- PlatformTools/LocalCatalog.cs | 7 +------ PlatformTools/LocalModuleCatalog.cs | 2 +- PlatformTools/ModuleInstallerFacade.cs | 2 +- PlatformTools/PackageManager.cs | 2 +- 8 files changed, 8 insertions(+), 12 deletions(-) diff --git a/PlatformTools/AppSettings.cs b/PlatformTools/AppSettings.cs index d9dff78..5f209ff 100644 --- a/PlatformTools/AppSettings.cs +++ b/PlatformTools/AppSettings.cs @@ -3,7 +3,7 @@ namespace PlatformTools { - internal class AppSettings + internal static class AppSettings { private static IConfiguration _configuration; diff --git a/PlatformTools/Build.PackageManager.cs b/PlatformTools/Build.PackageManager.cs index 2692289..da5d2d1 100644 --- a/PlatformTools/Build.PackageManager.cs +++ b/PlatformTools/Build.PackageManager.cs @@ -201,6 +201,7 @@ private bool NeedToInstallPlatform(string version) if (externalModule == null) { ControlFlow.Fail($"No module {module.Id} found"); + return; } if (alreadyInstalledModules.Any(installedModule => installedModule.ModuleName == module.Id && installedModule.Version.ToString() == module.Version)) diff --git a/PlatformTools/ExtModuleCatalog.cs b/PlatformTools/ExtModuleCatalog.cs index eaa9837..a1b9e3f 100644 --- a/PlatformTools/ExtModuleCatalog.cs +++ b/PlatformTools/ExtModuleCatalog.cs @@ -10,7 +10,7 @@ namespace PlatformTools { - internal class ExtModuleCatalog + internal static class ExtModuleCatalog { private static ExternalModuleCatalog _catalog; diff --git a/PlatformTools/GithubManager.cs b/PlatformTools/GithubManager.cs index 4dc24aa..24134e7 100644 --- a/PlatformTools/GithubManager.cs +++ b/PlatformTools/GithubManager.cs @@ -6,7 +6,7 @@ namespace PlatformTools { - internal class GithubManager + internal static class GithubManager { private static readonly string _githubUser = "virtocommerce"; private static readonly string _platformRepo = "vc-platform"; diff --git a/PlatformTools/LocalCatalog.cs b/PlatformTools/LocalCatalog.cs index f948cb1..ba294e8 100644 --- a/PlatformTools/LocalCatalog.cs +++ b/PlatformTools/LocalCatalog.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; @@ -184,11 +184,6 @@ private bool IsAssemblyRelatedFile(string path) return _options.AssemblyFileExtensions.Union(_options.AssemblyServiceFileExtensions).Any(x => path.EndsWith(x, StringComparison.OrdinalIgnoreCase)); } - private bool IsAssemblyFile(string path) - { - return _options.AssemblyFileExtensions.Any(x => path.EndsWith(x, StringComparison.OrdinalIgnoreCase)); - } - private bool IsLocalizationFile(string path) { return _options.LocalizationFileExtensions.Any(x => path.EndsWith(x, StringComparison.OrdinalIgnoreCase)); diff --git a/PlatformTools/LocalModuleCatalog.cs b/PlatformTools/LocalModuleCatalog.cs index 62a0f26..df21b54 100644 --- a/PlatformTools/LocalModuleCatalog.cs +++ b/PlatformTools/LocalModuleCatalog.cs @@ -6,7 +6,7 @@ namespace PlatformTools { - internal class LocalModuleCatalog + internal static class LocalModuleCatalog { private static LocalCatalog _catalog; diff --git a/PlatformTools/ModuleInstallerFacade.cs b/PlatformTools/ModuleInstallerFacade.cs index c4bbc69..9562acf 100644 --- a/PlatformTools/ModuleInstallerFacade.cs +++ b/PlatformTools/ModuleInstallerFacade.cs @@ -7,7 +7,7 @@ namespace PlatformTools { - internal class ModuleInstallerFacade + internal static class ModuleInstallerFacade { private static ModuleInstaller _moduleInstaller; diff --git a/PlatformTools/PackageManager.cs b/PlatformTools/PackageManager.cs index 95a0f90..21af0cb 100644 --- a/PlatformTools/PackageManager.cs +++ b/PlatformTools/PackageManager.cs @@ -3,7 +3,7 @@ namespace PlatformTools { - internal class PackageManager + internal static class PackageManager { private static readonly string _defaultModuleManifest = "https://raw.githubusercontent.com/VirtoCommerce/vc-modules/master/modules_v3.json";