Skip to content

Commit

Permalink
Fix: Sonar bugs and codesmells.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianareginalino committed Nov 29, 2023
1 parent 6fd60d2 commit 8fc3f14
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Liquid.Adapter.AzureStorage/BlobStorageAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ public class BlobStorageAdapter : ILiquidBlobStorageAdapter
{
private readonly IBlobClientFactory _factory;


/// <summary>
/// Initialize a new instance of <see cref="BlobStorageAdapter"/>
/// </summary>
/// <param name="factory"></param>
/// <exception cref="ArgumentNullException"></exception>
public BlobStorageAdapter(IBlobClientFactory factory)
{
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
Expand All @@ -32,9 +36,9 @@ public async Task DeleteByTags(IDictionary<string, string> tags, string containe
stringFilter = stringFilter + @$"""{tag.Key}"" = '{tag.Value}' AND ";

Check warning on line 36 in src/Liquid.Adapter.AzureStorage/BlobStorageAdapter.cs

View workflow job for this annotation

GitHub Actions / call-reusable-build-workflow / build

Use a StringBuilder instead.
}

stringFilter.Substring(0, stringFilter.Length - 4);
var filter = stringFilter.Substring(0, stringFilter.Length - 4);

await foreach (TaggedBlobItem blobItem in client.FindBlobsByTagsAsync(stringFilter))
await foreach (TaggedBlobItem blobItem in client.FindBlobsByTagsAsync(filter))
{
var blockBlob = client.GetBlockBlobClient(blobItem.BlobName);

Expand Down

0 comments on commit 8fc3f14

Please sign in to comment.