Skip to content

* fix some violations of Roslyn analyzer rules #45

* fix some violations of Roslyn analyzer rules

* fix some violations of Roslyn analyzer rules #45

Triggered via push March 26, 2024 13:12
Status Failure
Total duration 2m 33s
Artifacts

c#.yml

on: push
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

10 errors, 30 warnings, and 10 notices
ReSharper: c#/crawler/src/SonicPusher.cs#L45
"[CA1305] The behavior of 'ulong.ToString()' could vary based on the current user's locale settings. Replace this call in 'SonicPusher.PushPost(uint, string, ulong, RepeatedField<Content>)' with a call to 'ulong.ToString(IFormatProvider)'." on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(45,1816)
ReSharper: c#/crawler/src/SonicPusher.cs#L49
"[CA1848] For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogError(ILogger, Exception?, string?, params object?[])'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(49,1916)
ReSharper: c#/crawler/src/SonicPusher.cs#L54
"[CA1848] For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogWarning(ILogger, string?, params object?[])'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(54,2140)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L102
"[CA5351] PostJson uses a broken cryptographic algorithm MD5" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(102,4212)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L110
"[CA1848] For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string?, params object?[])'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(110,4569)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L142
"[CA1848] For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string?, params object?[])'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(142,6329)
ReSharper: c#/crawler/src/Tieba/ClientRequesterTcs.cs#L3
"[CA1001] Type 'ClientRequesterTcs' owns disposable field(s) '_timer' but is not disposable" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequesterTcs.cs(3,43)
ReSharper: c#/crawler/src/Tieba/ClientRequesterTcs.cs#L62
"[CA1848] For improved performance, use the LoggerMessage delegates instead of calling 'LoggerExtensions.LogTrace(ILogger, string?, params object?[])'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequesterTcs.cs(62,2276)
ReSharper: c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs#L5
"[CA1711] Either replace the suffix 'New' in type name New with the suggested numeric alternate '2' or provide a more meaningful suffix that distinguishes it from the type it replaces" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs(5,159)
ReSharper: c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs#L5
"[CA1716] Rename type ReplyCrawler.New so that it no longer conflicts with the reserved language keyword 'New'. Using a reserved keyword as the name of a type makes it harder for consumers in other languages to use the type." on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs(5,159)
build (imagePipeline): c#/imagePipeline/src/Ocr/PaddleOcrRecognizerAndDetector.cs#L7
Type 'PaddleOcrRecognizerAndDetector' contains the word 'and', which suggests it has multiple purposes (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1000.md)
build (imagePipeline): c#/imagePipeline/src/Ocr/PaddleOcrRecognizerAndDetector.cs#L50
Type 'PaddleOcrRecognizerAndDetector' contains the word 'and', which suggests it has multiple purposes (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1000.md)
build (imagePipeline): c#/imagePipeline/src/Ocr/TesseractRecognizer.cs#L140
Property 'PreprocessedTextBoxMat' contains the name of its containing type 'PreprocessedTextBox' (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1710.md)
build (imagePipeline): c#/imagePipeline/src/Db/ImageMetadata.cs#L46
Property 'DownloadedByteSize' contains the name of its containing type 'ByteSize' (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1710.md)
build (imagePipeline): c#/imagePipeline/src/Ocr/JointRecognizer.cs#L12
Field '_paddleOcrRecognizerAndDetector' contains the word 'and', which suggests doing multiple things (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1115.md)
build (imagePipeline): c#/imagePipeline/src/Consumer/MetadataConsumer.cs#L104
Use an overload of 'ToUpper' that has a 'System.Globalization.CultureInfo' parameter (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0011.md)
build (imagePipeline): c#/imagePipeline/src/Consumer/MetadataConsumer.cs#L104
Specify a culture or use an invariant version to avoid implicit dependency on current culture (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1311)
build (imagePipeline): c#/imagePipeline/src/Consumer/MetadataConsumer.cs#L104
The behavior of 'string.ToUpper()' could vary based on the current user's locale settings. Replace this call in 'MetadataConsumer.CreateEmbeddedFromProfile<TImageSharpProfile, TEmbeddedMetadata>(IEnumerable<ulong>, TImageSharpProfile, Func<TImageSharpProfile, byte[]>)' with a call to 'string.ToUpper(CultureInfo)'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1304)
build (crawler): c#/crawler/src/Helper.cs#L26
Overloaded method 'Helper.GetNowTimestamp()' should call another overload (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1551.md)
build (crawler): c#/crawler/src/Tieba/Crawl/CrawlerLocks.cs#L12
Property 'RegisteredCrawlerLocks' contains the name of its containing type 'CrawlerLocks' (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1710.md)
build (crawler): c#/crawler/src/Tieba/Crawl/ThreadLateCrawlerAndSaver.cs#L3
Type 'ThreadLateCrawlerAndSaver' contains the word 'and', which suggests it has multiple purposes (https://github.com/dennisdoomen/CSharpGuidelines/blob/5.6.0/_rules/1000.md)
ReSharper: c#/crawler/src/Db/Revision/RevisionWithSplitting.cs#L8
"[MA0016] Prefer using collection abstraction instead of implementation" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Db/Revision/RevisionWithSplitting.cs(8,252)
ReSharper: c#/crawler/src/Db/Revision/RevisionWithSplitting.cs#L35
"[AV1115] Method 'SplittingHasKeyAndName' contains the word 'and', which suggests doing multiple things" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Db/Revision/RevisionWithSplitting.cs(35,1495)
ReSharper: c#/crawler/src/Helper.cs#L10
"[AV1130] Return type in signature for 'Helper.SerializedProtoBufOrNullIfEmpty(IMessage?)' should be an interface to an unchangeable collection" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Helper.cs(10,312)
ReSharper: c#/crawler/src/Helper.cs#L13
"[AV1130] Return type in signature for 'Helper.SerializedProtoBufWrapperOrNullIfEmpty<T>(IEnumerable<T>?, Func<IMessage?>)' should be an interface to an unchangeable collection" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Helper.cs(13,485)
ReSharper: c#/crawler/src/Helper.cs#L19
"[AV1130] Return type in signature for 'Helper.ParseThenUnwrapPostContent(byte[]?)' should be an interface to an unchangeable collection" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Helper.cs(19,838)
ReSharper: c#/crawler/src/Helper.cs#L26
"[AV1551] Overloaded method 'Helper.GetNowTimestamp()' should call another overload" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Helper.cs(26,1262)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L22
"[MA0016] Prefer using collection abstraction instead of implementation" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(22,729)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L91
"[MA0002] Use an overload that has a IEqualityComparer<string> or IComparer<string> parameter" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(91,3731)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L126
"[CC0022] ByteArrayContent should be disposed." on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(126,5375)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L134
"[CC0008] You can use initializers in here." on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(134,5886)
ReSharper: c#/crawler/src/Db/Revision/RevisionWithSplitting.cs#L31
"[MA0038] Make method static (deprecated, use CA1822 instead)" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Db/Revision/RevisionWithSplitting.cs(31,1268)
ReSharper: c#/crawler/src/Db/Revision/RevisionWithSplitting.cs#L35
"[MA0038] Make method static (deprecated, use CA1822 instead)" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Db/Revision/RevisionWithSplitting.cs(35,1495)
ReSharper: c#/crawler/src/ExtensionMethods.cs#L3
"[AV1745] Name of extension method container class 'ExtensionMethods' should end with 'Extensions'" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/ExtensionMethods.cs(3,52)
ReSharper: c#/crawler/src/ExtensionMethods.cs#L70
"[AV1568] The value of parameter 'toCheck' is overwritten in its method body" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/ExtensionMethods.cs(70,2731)
ReSharper: c#/crawler/src/SonicPusher.cs#L33
"[MA0001] Use an overload of 'Replace' that has a StringComparison parameter" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(33,1237)
ReSharper: c#/crawler/src/SonicPusher.cs#L33
"[MA0001] Use an overload of 'Replace' that has a StringComparison parameter" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(33,1237)
ReSharper: c#/crawler/src/SonicPusher.cs#L33
"[MA0001] Use an overload of 'Replace' that has a StringComparison parameter" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(33,1237)
ReSharper: c#/crawler/src/SonicPusher.cs#L33
"[MA0089] Use an overload with char instead of string" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/SonicPusher.cs(33,1249)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L56
"[MA0001] Use an overload of 'Contains' that has a StringComparison parameter" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(56,2326)
ReSharper: c#/crawler/src/Tieba/ClientRequester.cs#L81
"[MA0076] Do not use implicit culture-sensitive ToString in interpolated strings" on /home/runner/work/open-tbm/open-tbm/c#/crawler/src/Tieba/ClientRequester.cs(81,3449)