mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 16:10:16 -04:00
Sonar code smells corrections
This commit is contained in:
@@ -22,7 +22,6 @@ namespace ModernKeePass.Services
|
||||
private StorageFile _realDatabaseFile;
|
||||
private StorageFile _databaseFile;
|
||||
private GroupVm _recycleBin;
|
||||
private CompositeKey _compositeKey;
|
||||
|
||||
public GroupVm RootGroup { get; set; }
|
||||
|
||||
@@ -57,11 +56,7 @@ namespace ModernKeePass.Services
|
||||
}
|
||||
}
|
||||
|
||||
public CompositeKey CompositeKey
|
||||
{
|
||||
get { return _compositeKey; }
|
||||
set { _compositeKey = value; }
|
||||
}
|
||||
public CompositeKey CompositeKey { get; set; }
|
||||
|
||||
public PwUuid DataCipher
|
||||
{
|
||||
@@ -112,7 +107,7 @@ namespace ModernKeePass.Services
|
||||
throw new ArgumentNullException(nameof(key));
|
||||
}
|
||||
|
||||
_compositeKey = key;
|
||||
CompositeKey = key;
|
||||
var ioConnection = IOConnectionInfo.FromFile(DatabaseFile);
|
||||
if (createNew)
|
||||
{
|
||||
@@ -153,7 +148,7 @@ namespace ModernKeePass.Services
|
||||
|
||||
public async Task ReOpen()
|
||||
{
|
||||
await Open(_compositeKey);
|
||||
await Open(CompositeKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -20,8 +20,7 @@ namespace ModernKeePass.Services
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<string, ProductListing> Products { get; }
|
||||
|
||||
//private LicenseInformation _licenseInformation;
|
||||
|
||||
private readonly HashSet<Guid> _consumedTransactionIds = new HashSet<Guid>();
|
||||
|
||||
public LicenseService()
|
||||
@@ -51,7 +50,7 @@ namespace ModernKeePass.Services
|
||||
case ProductPurchaseStatus.AlreadyPurchased:
|
||||
return (int) PurchaseResult.AlreadyPurchased;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
throw new ArgumentOutOfRangeException(nameof(purchaseResults.Status));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,6 +4,8 @@ namespace ModernKeePass.Services
|
||||
{
|
||||
public abstract class SingletonServiceBase<T> where T : new()
|
||||
{
|
||||
protected SingletonServiceBase() { }
|
||||
|
||||
private static readonly Lazy<T> LazyInstance =
|
||||
new Lazy<T>(() => new T());
|
||||
|
||||
|
Reference in New Issue
Block a user