Skip to content

Commit 040d79e

Browse files
committed
Sonar qube issues #3
1 parent 3b211f4 commit 040d79e

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

src/KeeperData.Core.Reports/Impl/CleanseReportExportService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ public async Task<CleanseReportExportResult> ExportAndUploadAsync(string operati
4848
operationId, timestamp);
4949

5050
// Step 1: Stream issues from MongoDB directly to CSV file
51-
tempCsvPath = Path.GetTempFileName();
51+
tempCsvPath = Path.GetRandomFileName();
5252
var recordCount = await StreamIssuesToCsvAsync(tempCsvPath, ct);
5353
_logger.LogInformation("Streamed {RecordCount} issues to CSV file at {TempPath}", recordCount, tempCsvPath);
5454

5555
// Step 2: Create zip file
56-
tempZipPath = Path.GetTempFileName();
56+
tempZipPath = Path.GetRandomFileName();
5757
CreateZipFile(tempCsvPath, tempZipPath, CsvFileName);
5858
_logger.LogInformation("Created zip file at {ZipPath}", tempZipPath);
5959

src/KeeperData.Core.Reports/Strategies/DataFields.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public static class SamHerd
2525
public const string Herdmark = "HERDMARK";
2626
public const string Intervals = "INTERVALS";
2727
public const string IntervalUnitOfTime = "INTERVAL_UNIT_OF_TIME";
28-
public const string IsDeleted = "IsDeleted";
2928
public const string KeeperPartyIds = "KEEPER_PARTY_IDS";
3029
public const string MovementRestrictionReasonCode = "MOVEMENT_RSTRCTN_RSN_CODE";
3130
public const string OwnerPartyIds = "OWNER_PARTY_IDS";
@@ -43,7 +42,6 @@ public static class CtsCphHoldingFields
4342
public const string BatchId = "BATCH_ID";
4443
public const string ChangeType = "CHANGE_TYPE";
4544
public const string CreatedAtUtc = "CreatedAtUtc";
46-
public const string IsDeleted = "IsDeleted";
4745
public const string LidFullIdentifier = "LID_FULL_IDENTIFIER";
4846
public const string LocEffectiveFrom = "LOC_EFFECTIVE_FROM";
4947
public const string LocEffectiveTo = "LOC_EFFECTIVE_TO";
@@ -65,7 +63,6 @@ public static class CtsKeeperFields
6563
public const string BatchId = "BATCH_ID";
6664
public const string ChangeType = "CHANGE_TYPE";
6765
public const string CreatedAtUtc = "CreatedAtUtc";
68-
public const string IsDeleted = "IsDeleted";
6966
public const string LidFullIdentifier = "LID_FULL_IDENTIFIER";
7067
public const string LprEffectiveFromDate = "LPR_EFFECTIVE_FROM_DATE";
7168
public const string LprEffectiveToDate = "LPR_EFFECTIVE_TO_DATE";
@@ -86,7 +83,6 @@ public static class SamPartyFields
8683
public const string CountryCode = "COUNTRY_CODE";
8784
public const string CreatedAtUtc = "CreatedAtUtc";
8885
public const string InternetEmailAddress = "INTERNET_EMAIL_ADDRESS";
89-
public const string IsDeleted = "IsDeleted";
9086
public const string Locality = "LOCALITY";
9187
public const string MobileNumber = "MOBILE_NUMBER";
9288
public const string OrganisationName = "ORGANISATION_NAME";
@@ -142,7 +138,6 @@ public static class SamCphHoldingFields
142138
public const string FeatureStatusCode = "FEATURE_STATUS_CODE";
143139
public const string Interval = "INTERVAL";
144140
public const string IntervalUnitOfTime = "INTERVAL_UNIT_OF_TIME";
145-
public const string IsDeleted = "IsDeleted";
146141
public const string Locality = "LOCALITY";
147142
public const string MovementRestrictionReasonCode = "MOVEMENT_RSTRCTN_RSN_CODE";
148143
public const string Northing = "NORTHING";

src/KeeperData.Core/Querying/Impl/ODataToFilterExpressionTranslator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace KeeperData.Core.Querying.Impl;
1212
internal class ODataToFilterExpressionTranslator
1313
{
1414
private readonly IEdmModel _model;
15-
private readonly IEdmEntityType _entityType;
1615

1716
public ODataToFilterExpressionTranslator()
1817
{
@@ -25,7 +24,6 @@ public ODataToFilterExpressionTranslator()
2524
model.AddElement(container);
2625

2726
_model = model;
28-
_entityType = entityType;
2927
}
3028

3129
public FilterExpression Parse(string filterExpression)

tests/KeeperData.Core.Tests.Unit/Crypto/ByteCountingStreamTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ public void Flush_FlushesInnerStream()
238238
sut.Write(new byte[] { 1, 2, 3 }, 0, 3);
239239

240240
// Act & Assert - should not throw
241-
sut.Flush();
241+
var act = () => sut.Flush();
242+
act.Should().NotThrow();
242243
}
243244

244245
[Fact]
@@ -250,7 +251,8 @@ public async Task FlushAsync_FlushesInnerStream()
250251
await sut.WriteAsync(new byte[] { 1, 2, 3 }, 0, 3);
251252

252253
// Act & Assert - should not throw
253-
await sut.FlushAsync();
254+
var act = () => sut.FlushAsync();
255+
await act.Should().NotThrowAsync();
254256
}
255257

256258
[Fact]

0 commit comments

Comments
 (0)