From c98f4512df35abb921a20eb3fff91a7cb8e9fa35 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sun, 28 May 2023 02:53:49 +0300 Subject: [PATCH] Enforce rule IDE0005 on build (cherry picked from commit 6b1e4ef81938d264a2ddc8b626b0502f799aa640) Closes #2555 --- src/Directory.Build.props | 7 +++ .../Extensions/BerghelRoach.cs | 56 +++++++++---------- src/NzbDrone.Common/OAuth/OAuthRequest.cs | 2 +- .../TorrentRss/TorrentRssSettingsDetector.cs | 10 ++-- .../Goodreads/Resources/ReviewResource.cs | 6 +- .../Goodreads/Resources/UserShelfResource.cs | 6 +- 6 files changed, 47 insertions(+), 40 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c75e21d65..69397d794 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -30,6 +30,13 @@ false true + + + true + + $(NoWarn);CS1591 diff --git a/src/NzbDrone.Common/Extensions/BerghelRoach.cs b/src/NzbDrone.Common/Extensions/BerghelRoach.cs index f8cf3525c..8592e23d6 100644 --- a/src/NzbDrone.Common/Extensions/BerghelRoach.cs +++ b/src/NzbDrone.Common/Extensions/BerghelRoach.cs @@ -356,34 +356,34 @@ namespace NzbDrone.Common.Extensions } /** - * Computes the highest row in which the distance {@code p} appears - * in diagonal {@code k} of the edit distance computation for - * strings {@code a} and {@code b}. The diagonal number is - * represented by the difference in the indices for the two strings; - * it can range from {@code -b.length()} through {@code a.length()}. - * - * More precisely, this computes the highest value x such that - *
- *     p = edit-distance(a[0:(x+k)), b[0:x)).
- * 
- * - * This is the "f" function described by Ukkonen. - * - * The caller must assure that abs(k) ≤ p, the only values for - * which this is well-defined. - * - * The implementation depends on the cached results of prior - * computeRow calls for diagonals k-1, k, and k+1 for distance p-1. - * These must be supplied in {@code knownLeft}, {@code knownAbove}, - * and {@code knownRight}, respectively. - * @param k diagonal number - * @param p edit distance - * @param a one string to be compared - * @param b other string to be compared - * @param knownLeft value of {@code computeRow(k-1, p-1, ...)} - * @param knownAbove value of {@code computeRow(k, p-1, ...)} - * @param knownRight value of {@code computeRow(k+1, p-1, ...)} - */ + * Computes the highest row in which the distance {@code p} appears + * in diagonal {@code k} of the edit distance computation for + * strings {@code a} and {@code b}. The diagonal number is + * represented by the difference in the indices for the two strings; + * it can range from {@code -b.length()} through {@code a.length()}. + * + * More precisely, this computes the highest value x such that + *
+         *     p = edit-distance(a[0:(x+k)), b[0:x)).
+         * 
+ * + * This is the "f" function described by Ukkonen. + * + * The caller must assure that abs(k) ≤ p, the only values for + * which this is well-defined. + * + * The implementation depends on the cached results of prior + * computeRow calls for diagonals k-1, k, and k+1 for distance p-1. + * These must be supplied in {@code knownLeft}, {@code knownAbove}, + * and {@code knownRight}, respectively. + * @param k diagonal number + * @param p edit distance + * @param a one string to be compared + * @param b other string to be compared + * @param knownLeft value of {@code computeRow(k-1, p-1, ...)} + * @param knownAbove value of {@code computeRow(k, p-1, ...)} + * @param knownRight value of {@code computeRow(k+1, p-1, ...)} + */ private static int ComputeRow(int k, int p, char[] a, diff --git a/src/NzbDrone.Common/OAuth/OAuthRequest.cs b/src/NzbDrone.Common/OAuth/OAuthRequest.cs index 641c39f04..ee9d5e533 100644 --- a/src/NzbDrone.Common/OAuth/OAuthRequest.cs +++ b/src/NzbDrone.Common/OAuth/OAuthRequest.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Common.OAuth public virtual string Version { get; set; } public virtual string SessionHandle { get; set; } - /// + /// public virtual string RequestUrl { get; set; } public virtual Dictionary Parameters { get; set; } diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs index d9bc95c22..503e3dfb8 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssSettingsDetector.cs @@ -35,13 +35,13 @@ namespace NzbDrone.Core.Indexers.TorrentRss /// /// Indexer Settings to use for Parser /// Parsed Settings or null - public TorrentRssIndexerParserSettings Detect(TorrentRssIndexerSettings indexerSettings) + public TorrentRssIndexerParserSettings Detect(TorrentRssIndexerSettings settings) { - _logger.Debug("Evaluating TorrentRss feed '{0}'", indexerSettings.BaseUrl); + _logger.Debug("Evaluating TorrentRss feed '{0}'", settings.BaseUrl); try { - var requestGenerator = new TorrentRssIndexerRequestGenerator { Settings = indexerSettings }; + var requestGenerator = new TorrentRssIndexerRequestGenerator { Settings = settings }; var request = requestGenerator.GetRecentRequests().GetAllTiers().First().First(); HttpResponse httpResponse = null; @@ -56,11 +56,11 @@ namespace NzbDrone.Core.Indexers.TorrentRss } var indexerResponse = new IndexerResponse(request, httpResponse); - return GetParserSettings(indexerResponse, indexerSettings); + return GetParserSettings(indexerResponse, settings); } catch (Exception ex) { - ex.WithData("FeedUrl", indexerSettings.BaseUrl); + ex.WithData("FeedUrl", settings.BaseUrl); throw; } } diff --git a/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/ReviewResource.cs b/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/ReviewResource.cs index 04cbc20dd..1a4e396f8 100644 --- a/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/ReviewResource.cs +++ b/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/ReviewResource.cs @@ -40,9 +40,9 @@ namespace NzbDrone.Core.MetadataSource.Goodreads /// public string SpoilersState { get; protected set; } - /// - /// The shelves the user has added this review to. - /// + // /// + // /// The shelves the user has added this review to. + // /// // public IReadOnlyList Shelves { get; protected set; } /// diff --git a/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/UserShelfResource.cs b/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/UserShelfResource.cs index 9cb79d9ec..5db076f73 100644 --- a/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/UserShelfResource.cs +++ b/src/NzbDrone.Core/MetadataSource/Goodreads/Resources/UserShelfResource.cs @@ -41,9 +41,9 @@ namespace NzbDrone.Core.MetadataSource.Goodreads /// public string Sort { get; private set; } - /// - /// Determines the default sort order of this user shelf. - /// + // /// + // /// Determines the default sort order of this user shelf. + // /// // public Order? Order { get; private set; } ///