Skip to content

Commit

Permalink
code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Aug 1, 2023
1 parent 11ad105 commit d3c6989
Show file tree
Hide file tree
Showing 3 changed files with 343 additions and 368 deletions.
2 changes: 2 additions & 0 deletions starsky/starsky.feature.import/Services/Import.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -69,6 +70,7 @@ public class Import : IImport
/// </summary>
internal const string MessageDateTimeBasedOnFilename = "Date and Time based on filename";

[SuppressMessage("Usage", "S107: Constructor has 8 parameters, which is greater than the 7 authorized")]
public Import(
ISelectorStorage selectorStorage,
AppSettings appSettings,
Expand Down
6 changes: 4 additions & 2 deletions starsky/starsky.feature.search/ViewModels/SearchViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public SearchViewModel()
Breadcrumb ??= new List<string>();

// to know how long a query takes
_dateTime = DateTime.Now;
_dateTime = DateTime.UtcNow;
}

/// <summary>
Expand Down Expand Up @@ -275,7 +275,9 @@ public double ElapsedSeconds
/// Used to know how old the search query is
/// Used to know if a page is cached
/// </summary>
public double Offset => Math.Round(Math.Abs((DateTime.Now - _dateTime).TotalSeconds),2);
[SuppressMessage("Usage", "S6561: Avoid using DateTime.Now " +
"for benchmarking or timespan calculation operations.")]
public double Offset => Math.Round(Math.Abs((DateTime.UtcNow - _dateTime).TotalSeconds), 2);


/// <summary>
Expand Down
Loading

0 comments on commit d3c6989

Please sign in to comment.