From 553c5f66c4021f26d585caf0701020b7232e0f0b Mon Sep 17 00:00:00 2001 From: Cristian Ambrosini <114916336+cristian-ambrosini-sonarsource@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:56:38 +0200 Subject: [PATCH] New rule S6566: Always use DateTimeOffset instead of DateTime (#7523) --- ...5E-C6AE-4D2D-A9DD-B6EFD19A4279}-S6566.json | 56 ++ ...AF-4FDC-416A-B3E0-968C1C8F3F83}-S6566.json | 82 +++ ...31-1F7B-4637-9B3A-806988DE50CF}-S6566.json | 56 ++ .../expected/Nancy/Nancy--net452-S6566.json | 69 +++ .../Nancy/Nancy--netstandard2.0-S6566.json | 69 +++ ...cy.Authentication.Forms--net452-S6566.json | 17 + ...ntication.Forms--netstandard2.0-S6566.json | 17 + ...Nancy.ViewEngines.Spark--net452-S6566.json | 17 + ...6-462B-BFAC-33B3491365B5-net5.0-S6566.json | 17 + ...D-48B4-AE0B-D9A643E16D1F-net5.0-S6566.json | 17 + .../akka.net/Akka--netstandard2.0-S6566.json | 238 ++++++++ .../Akka.Cluster--netstandard2.0-S6566.json | 147 +++++ ...Cluster.Metrics--netstandard2.0-S6566.json | 17 + ...luster.Sharding--netstandard2.0-S6566.json | 43 ++ ...a.Cluster.Tools--netstandard2.0-S6566.json | 17 + ...DistributedData--netstandard2.0-S6566.json | 199 ++++++ ...kka.MultiNodeTestRunner--net471-S6566.json | 17 + ...kka.MultiNodeTestRunner--net5.0-S6566.json | 17 + ...tiNodeTestRunner--netcoreapp3.1-S6566.json | 17 + ...stRunner.Shared--netstandard2.0-S6566.json | 576 ++++++++++++++++++ ...kka.Persistence--netstandard2.0-S6566.json | 212 +++++++ ...ence.Sql.Common--netstandard2.0-S6566.json | 56 ++ ...sistence.Sqlite--netstandard2.0-S6566.json | 17 + ...Persistence.TCK--netstandard2.0-S6566.json | 17 + .../Akka.Remote--netstandard2.0-S6566.json | 56 ++ .../Akka.Streams--netstandard2.0-S6566.json | 251 ++++++++ ...Streams.TestKit--netstandard2.0-S6566.json | 30 + .../Akka.TestKit--netstandard2.0-S6566.json | 17 + ...ests.Performance--netcoreapp3.1-S6566.json | 30 + .../PersistenceBenchmark--net471-S6566.json | 30 + analyzers/rspec/cs/S6566.html | 48 ++ analyzers/rspec/cs/S6566.json | 15 + analyzers/rspec/vbnet/S6566.html | 48 ++ analyzers/rspec/vbnet/S6566.json | 15 + .../UseDateTimeInsteadOfDateTimeOffset.cs | 29 + .../UseDateTimeInsteadOfDateTimeOffsetBase.cs | 81 +++ .../UseDateTimeInsteadOfDateTimeOffset.cs | 29 + .../PackagingTests/RuleTypeMappingCS.cs | 2 +- .../PackagingTests/RuleTypeMappingVB.cs | 2 +- .../UseDateTimeInsteadOfDateTimeOffsetTest.cs | 51 ++ ...DateTimeInsteadOfDateTimeOffset.CSharp9.cs | 13 + .../UseDateTimeInsteadOfDateTimeOffset.Net.vb | 20 + .../UseDateTimeInsteadOfDateTimeOffset.cs | 98 +++ .../UseDateTimeInsteadOfDateTimeOffset.vb | 96 +++ 44 files changed, 2966 insertions(+), 2 deletions(-) create mode 100644 analyzers/its/expected/Ember-MM/EmberAPI-{208AA35E-C6AE-4D2D-A9DD-B6EFD19A4279}-S6566.json create mode 100644 analyzers/its/expected/Ember-MM/generic.EmberCore.Extractor-{B413DEAF-4FDC-416A-B3E0-968C1C8F3F83}-S6566.json create mode 100644 analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S6566.json create mode 100644 analyzers/its/expected/Nancy/Nancy--net452-S6566.json create mode 100644 analyzers/its/expected/Nancy/Nancy--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/Nancy/Nancy.Authentication.Forms--net452-S6566.json create mode 100644 analyzers/its/expected/Nancy/Nancy.Authentication.Forms--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S6566.json create mode 100644 analyzers/its/expected/Net5/jsonserializerrecords-38409230-12D6-462B-BFAC-33B3491365B5-net5.0-S6566.json create mode 100644 analyzers/its/expected/Net5/recordswithstatichelper-541512C1-D79D-48B4-AE0B-D9A643E16D1F-net5.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net471-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net5.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--netcoreapp3.1-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Persistence.TCK--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S6566.json create mode 100644 analyzers/its/expected/akka.net/Akka.Tests.Performance--netcoreapp3.1-S6566.json create mode 100644 analyzers/its/expected/akka.net/PersistenceBenchmark--net471-S6566.json create mode 100644 analyzers/rspec/cs/S6566.html create mode 100644 analyzers/rspec/cs/S6566.json create mode 100644 analyzers/rspec/vbnet/S6566.html create mode 100644 analyzers/rspec/vbnet/S6566.json create mode 100644 analyzers/src/SonarAnalyzer.CSharp/Rules/UseDateTimeInsteadOfDateTimeOffset.cs create mode 100644 analyzers/src/SonarAnalyzer.Common/Rules/UseDateTimeInsteadOfDateTimeOffsetBase.cs create mode 100644 analyzers/src/SonarAnalyzer.VisualBasic/Rules/UseDateTimeInsteadOfDateTimeOffset.cs create mode 100644 analyzers/tests/SonarAnalyzer.UnitTest/Rules/UseDateTimeInsteadOfDateTimeOffsetTest.cs create mode 100644 analyzers/tests/SonarAnalyzer.UnitTest/TestCases/UseDateTimeInsteadOfDateTimeOffset.CSharp9.cs create mode 100644 analyzers/tests/SonarAnalyzer.UnitTest/TestCases/UseDateTimeInsteadOfDateTimeOffset.Net.vb create mode 100644 analyzers/tests/SonarAnalyzer.UnitTest/TestCases/UseDateTimeInsteadOfDateTimeOffset.cs create mode 100644 analyzers/tests/SonarAnalyzer.UnitTest/TestCases/UseDateTimeInsteadOfDateTimeOffset.vb diff --git a/analyzers/its/expected/Ember-MM/EmberAPI-{208AA35E-C6AE-4D2D-A9DD-B6EFD19A4279}-S6566.json b/analyzers/its/expected/Ember-MM/EmberAPI-{208AA35E-C6AE-4D2D-A9DD-B6EFD19A4279}-S6566.json new file mode 100644 index 00000000000..d0e783f549f --- /dev/null +++ b/analyzers/its/expected/Ember-MM/EmberAPI-{208AA35E-C6AE-4D2D-A9DD-B6EFD19A4279}-S6566.json @@ -0,0 +1,56 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\EmberAPI\clsAPICommon.vb", +"region": { +"startLine": 711, +"startColumn": 34, +"endLine": 711, +"endColumn": 70 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\EmberAPI\clsAPICommon.vb", +"region": { +"startLine": 716, +"startColumn": 34, +"endLine": 716, +"endColumn": 70 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\EmberAPI\clsAPIErrorLog.vb", +"region": { +"startLine": 60, +"startColumn": 63, +"endLine": 60, +"endColumn": 71 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\EmberAPI\clsAPIScanner.vb", +"region": { +"startLine": 32, +"startColumn": 30, +"endLine": 32, +"endColumn": 42 +} +} +} +] +} diff --git a/analyzers/its/expected/Ember-MM/generic.EmberCore.Extractor-{B413DEAF-4FDC-416A-B3E0-968C1C8F3F83}-S6566.json b/analyzers/its/expected/Ember-MM/generic.EmberCore.Extractor-{B413DEAF-4FDC-416A-B3E0-968C1C8F3F83}-S6566.json new file mode 100644 index 00000000000..9069884175e --- /dev/null +++ b/analyzers/its/expected/Ember-MM/generic.EmberCore.Extractor-{B413DEAF-4FDC-416A-B3E0-968C1C8F3F83}-S6566.json @@ -0,0 +1,82 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\clsExtractor.vb", +"region": { +"startLine": 185, +"startColumn": 91, +"endLine": 185, +"endColumn": 99 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\clsExtractor.vb", +"region": { +"startLine": 185, +"startColumn": 145, +"endLine": 185, +"endColumn": 153 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\frmMovieExtractor.vb", +"region": { +"startLine": 31, +"startColumn": 67, +"endLine": 31, +"endColumn": 75 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\frmMovieExtractor.vb", +"region": { +"startLine": 31, +"startColumn": 121, +"endLine": 31, +"endColumn": 129 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\frmTVExtrator.vb", +"region": { +"startLine": 62, +"startColumn": 91, +"endLine": 62, +"endColumn": 99 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\generic.EmberCore.Extractor\frmTVExtrator.vb", +"region": { +"startLine": 62, +"startColumn": 145, +"endLine": 62, +"endColumn": 153 +} +} +} +] +} diff --git a/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S6566.json b/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S6566.json new file mode 100644 index 00000000000..d56667e3201 --- /dev/null +++ b/analyzers/its/expected/Ember-MM/scraper.EmberCore.XML-{E567C031-1F7B-4637-9B3A-806988DE50CF}-S6566.json @@ -0,0 +1,56 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\MediaTags\MediaTag.vb", +"region": { +"startLine": 59, +"startColumn": 34, +"endLine": 59, +"endColumn": 42 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\ScraperLib\Scraper.vb", +"region": { +"startLine": 69, +"startColumn": 31, +"endLine": 69, +"endColumn": 39 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\ScraperLib\Scraper.vb", +"region": { +"startLine": 290, +"startColumn": 35, +"endLine": 290, +"endColumn": 43 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Ember-MM\Addons\scraper.EmberCore.XML\XMLScraper\ScraperLib\Scraper.vb", +"region": { +"startLine": 511, +"startColumn": 34, +"endLine": 511, +"endColumn": 42 +} +} +} +] +} diff --git a/analyzers/its/expected/Nancy/Nancy--net452-S6566.json b/analyzers/its/expected/Nancy/Nancy--net452-S6566.json new file mode 100644 index 00000000000..f81f7e9cbe9 --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy--net452-S6566.json @@ -0,0 +1,69 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 169, +"startColumn": 106, +"endLine": 169, +"endColumn": 114 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 207, +"startColumn": 30, +"endLine": 207, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 283, +"startColumn": 26, +"endLine": 283, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Json\Simple\NancySerializationStrategy.cs", +"region": { +"startLine": 208, +"startColumn": 28, +"endLine": 208, +"endColumn": 76 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\NancyEngine.cs", +"region": { +"startLine": 215, +"startColumn": 27, +"endLine": 215, +"endColumn": 35 +} +} +} +] +} diff --git a/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S6566.json b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S6566.json new file mode 100644 index 00000000000..f81f7e9cbe9 --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy--netstandard2.0-S6566.json @@ -0,0 +1,69 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 169, +"startColumn": 106, +"endLine": 169, +"endColumn": 114 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 207, +"startColumn": 30, +"endLine": 207, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Diagnostics\DiagnosticsHook.cs", +"region": { +"startLine": 283, +"startColumn": 26, +"endLine": 283, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\Json\Simple\NancySerializationStrategy.cs", +"region": { +"startLine": 208, +"startColumn": 28, +"endLine": 208, +"endColumn": 76 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy\NancyEngine.cs", +"region": { +"startLine": 215, +"startColumn": 27, +"endLine": 215, +"endColumn": 35 +} +} +} +] +} diff --git a/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--net452-S6566.json b/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--net452-S6566.json new file mode 100644 index 00000000000..2dada4391a8 --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--net452-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy.Authentication.Forms\FormsAuthentication.cs", +"region": { +"startLine": 301, +"startColumn": 120, +"endLine": 301, +"endColumn": 128 +} +} +} +] +} diff --git a/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--netstandard2.0-S6566.json b/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--netstandard2.0-S6566.json new file mode 100644 index 00000000000..2dada4391a8 --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy.Authentication.Forms--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy.Authentication.Forms\FormsAuthentication.cs", +"region": { +"startLine": 301, +"startColumn": 120, +"endLine": 301, +"endColumn": 128 +} +} +} +] +} diff --git a/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S6566.json b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S6566.json new file mode 100644 index 00000000000..5ea59662015 --- /dev/null +++ b/analyzers/its/expected/Nancy/Nancy.ViewEngines.Spark--net452-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Nancy\src\Nancy.ViewEngines.Spark\NancyViewFolder.cs", +"region": { +"startLine": 242, +"startColumn": 40, +"endLine": 242, +"endColumn": 48 +} +} +} +] +} diff --git a/analyzers/its/expected/Net5/jsonserializerrecords-38409230-12D6-462B-BFAC-33B3491365B5-net5.0-S6566.json b/analyzers/its/expected/Net5/jsonserializerrecords-38409230-12D6-462B-BFAC-33B3491365B5-net5.0-S6566.json new file mode 100644 index 00000000000..0f0fb055b6b --- /dev/null +++ b/analyzers/its/expected/Net5/jsonserializerrecords-38409230-12D6-462B-BFAC-33B3491365B5-net5.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Net5\Net5Samples\JsonSerializerRecords\Program.cs", +"region": { +"startLine": 4, +"startColumn": 25, +"endLine": 4, +"endColumn": 33 +} +} +} +] +} diff --git a/analyzers/its/expected/Net5/recordswithstatichelper-541512C1-D79D-48B4-AE0B-D9A643E16D1F-net5.0-S6566.json b/analyzers/its/expected/Net5/recordswithstatichelper-541512C1-D79D-48B4-AE0B-D9A643E16D1F-net5.0-S6566.json new file mode 100644 index 00000000000..fd9847182c2 --- /dev/null +++ b/analyzers/its/expected/Net5/recordswithstatichelper-541512C1-D79D-48B4-AE0B-D9A643E16D1F-net5.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\Net5\Net5Samples\RecordWithStaticHelper\Program.cs", +"region": { +"startLine": 4, +"startColumn": 37, +"endLine": 4, +"endColumn": 45 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka--netstandard2.0-S6566.json new file mode 100644 index 00000000000..cec49ad7f0f --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka--netstandard2.0-S6566.json @@ -0,0 +1,238 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\ActorSystem.cs", +"region": { +"startLine": 216, +"startColumn": 46, +"endLine": 216, +"endColumn": 54 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Actor\ActorSystem.cs", +"region": { +"startLine": 216, +"startColumn": 64, +"endLine": 216, +"endColumn": 115 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Dispatch\Mailbox.cs", +"region": { +"startLine": 535, +"startColumn": 70, +"endLine": 535, +"endColumn": 78 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Event\DeadLetterListener.cs", +"region": { +"startLine": 235, +"startColumn": 38, +"endLine": 235, +"endColumn": 46 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Event\DeadLetterListener.cs", +"region": { +"startLine": 240, +"startColumn": 40, +"endLine": 240, +"endColumn": 48 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Event\DeadLetterListener.cs", +"region": { +"startLine": 255, +"startColumn": 60, +"endLine": 255, +"endColumn": 68 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Event\DeadLetterListener.cs", +"region": { +"startLine": 276, +"startColumn": 56, +"endLine": 276, +"endColumn": 64 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Event\LogEvent.cs", +"region": { +"startLine": 51, +"startColumn": 25, +"endLine": 51, +"endColumn": 33 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\IO\SimpleDnsCache.cs", +"region": { +"startLine": 40, +"startColumn": 26, +"endLine": 40, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\IO\SimpleDnsCache.cs", +"region": { +"startLine": 59, +"startColumn": 23, +"endLine": 59, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Pattern\CircuitBreakerState.cs", +"region": { +"startLine": 40, +"startColumn": 30, +"endLine": 40, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Pattern\CircuitBreakerState.cs", +"region": { +"startLine": 94, +"startColumn": 23, +"endLine": 94, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\Extensions\DateTimeExtensions.cs", +"region": { +"startLine": 22, +"startColumn": 38, +"endLine": 22, +"endColumn": 62 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\Internal\AtomicState.cs", +"region": { +"startLine": 87, +"startColumn": 28, +"endLine": 87, +"endColumn": 36 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\Internal\AtomicState.cs", +"region": { +"startLine": 105, +"startColumn": 22, +"endLine": 105, +"endColumn": 30 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\Internal\AtomicState.cs", +"region": { +"startLine": 130, +"startColumn": 28, +"endLine": 130, +"endColumn": 36 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\Internal\AtomicState.cs", +"region": { +"startLine": 148, +"startColumn": 22, +"endLine": 148, +"endColumn": 30 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka\Util\TokenBucket.cs", +"region": { +"startLine": 139, +"startColumn": 45, +"endLine": 139, +"endColumn": 53 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S6566.json new file mode 100644 index 00000000000..2cef512655f --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Cluster--netstandard2.0-S6566.json @@ -0,0 +1,147 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterHeartbeat.cs", +"region": { +"startLine": 85, +"startColumn": 30, +"endLine": 85, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterHeartbeat.cs", +"region": { +"startLine": 155, +"startColumn": 34, +"endLine": 155, +"endColumn": 42 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterHeartbeat.cs", +"region": { +"startLine": 241, +"startColumn": 23, +"endLine": 241, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\ClusterHeartbeat.cs", +"region": { +"startLine": 253, +"startColumn": 30, +"endLine": 253, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 85, +"startColumn": 42, +"endLine": 85, +"endColumn": 50 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 85, +"startColumn": 59, +"endLine": 85, +"endColumn": 67 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 144, +"startColumn": 23, +"endLine": 144, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 171, +"startColumn": 25, +"endLine": 171, +"endColumn": 33 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 298, +"startColumn": 27, +"endLine": 298, +"endColumn": 35 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 556, +"startColumn": 23, +"endLine": 556, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Cluster\SBR\SplitBrainResolver.cs", +"region": { +"startLine": 732, +"startColumn": 27, +"endLine": 732, +"endColumn": 35 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S6566.json new file mode 100644 index 00000000000..c4c8ed78c22 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Metrics--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Metrics\Collectors\DefaultCollector.cs", +"region": { +"startLine": 78, +"startColumn": 50, +"endLine": 78, +"endColumn": 58 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S6566.json new file mode 100644 index 00000000000..2cfddb8c936 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Sharding--netstandard2.0-S6566.json @@ -0,0 +1,43 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\PersistentShard.cs", +"region": { +"startLine": 125, +"startColumn": 77, +"endLine": 125, +"endColumn": 85 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\Shard.cs", +"region": { +"startLine": 832, +"startColumn": 85, +"endLine": 832, +"endColumn": 93 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Sharding\Shard.cs", +"region": { +"startLine": 839, +"startColumn": 28, +"endLine": 839, +"endColumn": 36 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S6566.json new file mode 100644 index 00000000000..c949eb4b269 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Cluster.Tools--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.Cluster.Tools\PublishSubscribe\DistributedPubSubMediator.cs", +"region": { +"startLine": 639, +"startColumn": 27, +"endLine": 639, +"endColumn": 35 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S6566.json new file mode 100644 index 00000000000..47e263bc1b8 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.DistributedData--netstandard2.0-S6566.json @@ -0,0 +1,199 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Internal\Internal.cs", +"region": { +"startLine": 481, +"startColumn": 31, +"endLine": 481, +"endColumn": 39 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\LWWRegister.cs", +"region": { +"startLine": 91, +"startColumn": 44, +"endLine": 91, +"endColumn": 52 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\LWWRegister.cs", +"region": { +"startLine": 98, +"startColumn": 45, +"endLine": 98, +"endColumn": 53 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 383, +"startColumn": 34, +"endLine": 383, +"endColumn": 42 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 416, +"startColumn": 30, +"endLine": 416, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 474, +"startColumn": 26, +"endLine": 474, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 1331, +"startColumn": 23, +"endLine": 1331, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 1420, +"startColumn": 58, +"endLine": 1420, +"endColumn": 66 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 1421, +"startColumn": 65, +"endLine": 1421, +"endColumn": 73 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Replicator.cs", +"region": { +"startLine": 1450, +"startColumn": 31, +"endLine": 1450, +"endColumn": 39 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", +"region": { +"startLine": 53, +"startColumn": 29, +"endLine": 53, +"endColumn": 37 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", +"region": { +"startLine": 74, +"startColumn": 29, +"endLine": 74, +"endColumn": 37 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", +"region": { +"startLine": 108, +"startColumn": 21, +"endLine": 108, +"endColumn": 29 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", +"region": { +"startLine": 117, +"startColumn": 29, +"endLine": 117, +"endColumn": 37 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\cluster\Akka.DistributedData\Serialization\ReplicatorMessageSerializer.cs", +"region": { +"startLine": 578, +"startColumn": 67, +"endLine": 578, +"endColumn": 99 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net471-S6566.json b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net471-S6566.json new file mode 100644 index 00000000000..adcb12a6ac7 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net471-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner\Program.cs", +"region": { +"startLine": 476, +"startColumn": 23, +"endLine": 476, +"endColumn": 31 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net5.0-S6566.json b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net5.0-S6566.json new file mode 100644 index 00000000000..adcb12a6ac7 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--net5.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner\Program.cs", +"region": { +"startLine": 476, +"startColumn": 23, +"endLine": 476, +"endColumn": 31 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--netcoreapp3.1-S6566.json b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--netcoreapp3.1-S6566.json new file mode 100644 index 00000000000..adcb12a6ac7 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner--netcoreapp3.1-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner\Program.cs", +"region": { +"startLine": 476, +"startColumn": 23, +"endLine": 476, +"endColumn": 31 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S6566.json new file mode 100644 index 00000000000..c77104fa3cb --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.MultiNodeTestRunner.Shared--netstandard2.0-S6566.json @@ -0,0 +1,576 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\FileNameGenerator.cs", +"region": { +"startLine": 17, +"startColumn": 76, +"endLine": 17, +"endColumn": 84 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\TimelineItemFactory.cs", +"region": { +"startLine": 38, +"startColumn": 73, +"endLine": 38, +"endColumn": 101 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\TimelineItemFactory.cs", +"region": { +"startLine": 48, +"startColumn": 84, +"endLine": 48, +"endColumn": 112 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\VisualizerRuntimeTemplate.Tree.cs", +"region": { +"startLine": 100, +"startColumn": 38, +"endLine": 100, +"endColumn": 71 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Persistence\VisualizerRuntimeTemplate.Tree.cs", +"region": { +"startLine": 101, +"startColumn": 38, +"endLine": 101, +"endColumn": 70 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunCoordinator.cs", +"region": { +"startLine": 61, +"startColumn": 44, +"endLine": 61, +"endColumn": 52 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunCoordinator.cs", +"region": { +"startLine": 89, +"startColumn": 95, +"endLine": 89, +"endColumn": 103 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 61, +"startColumn": 45, +"endLine": 61, +"endColumn": 72 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 61, +"startColumn": 75, +"endLine": 61, +"endColumn": 83 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 61, +"startColumn": 94, +"endLine": 61, +"endColumn": 117 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 76, +"startColumn": 27, +"endLine": 76, +"endColumn": 35 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 143, +"startColumn": 30, +"endLine": 143, +"endColumn": 38 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 196, +"startColumn": 45, +"endLine": 196, +"endColumn": 72 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 196, +"startColumn": 75, +"endLine": 196, +"endColumn": 83 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 196, +"startColumn": 94, +"endLine": 196, +"endColumn": 117 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 206, +"startColumn": 27, +"endLine": 206, +"endColumn": 35 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 287, +"startColumn": 85, +"endLine": 287, +"endColumn": 93 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 350, +"startColumn": 45, +"endLine": 350, +"endColumn": 72 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 350, +"startColumn": 75, +"endLine": 350, +"endColumn": 83 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 350, +"startColumn": 94, +"endLine": 350, +"endColumn": 117 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Reporting\TestRunTree.cs", +"region": { +"startLine": 372, +"startColumn": 27, +"endLine": 372, +"endColumn": 35 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 42, +"startColumn": 63, +"endLine": 42, +"endColumn": 109 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 49, +"startColumn": 17, +"endLine": 49, +"endColumn": 102 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 49, +"startColumn": 61, +"endLine": 49, +"endColumn": 69 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 143, +"startColumn": 53, +"endLine": 143, +"endColumn": 61 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 150, +"startColumn": 92, +"endLine": 150, +"endColumn": 100 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\ConsoleMessageSinkActor.cs", +"region": { +"startLine": 157, +"startColumn": 92, +"endLine": 157, +"endColumn": 100 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\MessageSink.cs", +"region": { +"startLine": 145, +"startColumn": 86, +"endLine": 145, +"endColumn": 94 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\MessageSink.cs", +"region": { +"startLine": 164, +"startColumn": 73, +"endLine": 164, +"endColumn": 81 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\MessageSink.cs", +"region": { +"startLine": 239, +"startColumn": 82, +"endLine": 239, +"endColumn": 90 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\Spec.cs", +"region": { +"startLine": 31, +"startColumn": 25, +"endLine": 31, +"endColumn": 33 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TeamCityMessageSinkActor.cs", +"region": { +"startLine": 76, +"startColumn": 73, +"endLine": 76, +"endColumn": 81 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TeamCityMessageSinkActor.cs", +"region": { +"startLine": 86, +"startColumn": 67, +"endLine": 86, +"endColumn": 75 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TestCoordinatorEnabledMessageSink.cs", +"region": { +"startLine": 98, +"startColumn": 62, +"endLine": 98, +"endColumn": 70 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TestCoordinatorEnabledMessageSink.cs", +"region": { +"startLine": 109, +"startColumn": 62, +"endLine": 109, +"endColumn": 70 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\Sinks\TimelineLogCollectorActor.cs", +"region": { +"startLine": 100, +"startColumn": 24, +"endLine": 100, +"endColumn": 32 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\Models\Times.cs", +"region": { +"startLine": 18, +"startColumn": 23, +"endLine": 18, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\Models\UnitTestResult.cs", +"region": { +"startLine": 26, +"startColumn": 23, +"endLine": 26, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\SpecSession.cs", +"region": { +"startLine": 26, +"startColumn": 88, +"endLine": 26, +"endColumn": 96 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\SpecSession.cs", +"region": { +"startLine": 27, +"startColumn": 129, +"endLine": 27, +"endColumn": 137 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\SpecSession.cs", +"region": { +"startLine": 28, +"startColumn": 119, +"endLine": 28, +"endColumn": 127 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\SpecSession.cs", +"region": { +"startLine": 29, +"startColumn": 122, +"endLine": 29, +"endColumn": 130 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\SpecSession.cs", +"region": { +"startLine": 30, +"startColumn": 74, +"endLine": 30, +"endColumn": 82 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.MultiNodeTestRunner.Shared\TrxReporter\TrxSinkActor.cs", +"region": { +"startLine": 102, +"startColumn": 77, +"endLine": 102, +"endColumn": 85 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S6566.json new file mode 100644 index 00000000000..31bce215e1e --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Persistence--netstandard2.0-S6566.json @@ -0,0 +1,212 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 408, +"startColumn": 43, +"endLine": 408, +"endColumn": 51 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 408, +"startColumn": 81, +"endLine": 408, +"endColumn": 89 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 437, +"startColumn": 28, +"endLine": 437, +"endColumn": 36 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\AtLeastOnceDeliverySemantic.cs", +"region": { +"startLine": 501, +"startColumn": 23, +"endLine": 501, +"endColumn": 31 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\LocalSnapshotStore.cs", +"region": { +"startLine": 295, +"startColumn": 66, +"endLine": 295, +"endColumn": 85 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\MemorySnapshotStore.cs", +"region": { +"startLine": 31, +"startColumn": 111, +"endLine": 31, +"endColumn": 119 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\MemorySnapshotStore.cs", +"region": { +"startLine": 31, +"startColumn": 154, +"endLine": 31, +"endColumn": 162 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\MemorySnapshotStore.cs", +"region": { +"startLine": 85, +"startColumn": 39, +"endLine": 85, +"endColumn": 47 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\MemorySnapshotStore.cs", +"region": { +"startLine": 85, +"startColumn": 85, +"endLine": 85, +"endColumn": 93 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\MemorySnapshotStore.cs", +"region": { +"startLine": 102, +"startColumn": 101, +"endLine": 102, +"endColumn": 130 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\Snapshot\SnapshotStore.cs", +"region": { +"startLine": 78, +"startColumn": 124, +"endLine": 78, +"endColumn": 132 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 62, +"startColumn": 56, +"endLine": 62, +"endColumn": 64 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 481, +"startColumn": 112, +"endLine": 481, +"endColumn": 120 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 486, +"startColumn": 99, +"endLine": 486, +"endColumn": 107 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 501, +"startColumn": 44, +"endLine": 501, +"endColumn": 52 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence\SnapshotProtocol.cs", +"region": { +"startLine": 508, +"startColumn": 84, +"endLine": 508, +"endColumn": 92 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S6566.json new file mode 100644 index 00000000000..79b51d8084b --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Sql.Common--netstandard2.0-S6566.json @@ -0,0 +1,56 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\BatchingSqlJournal.cs", +"region": { +"startLine": 1279, +"startColumn": 66, +"endLine": 1279, +"endColumn": 74 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\ITimestampProvider.cs", +"region": { +"startLine": 35, +"startColumn": 77, +"endLine": 35, +"endColumn": 85 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Journal\QueryExecutor.cs", +"region": { +"startLine": 687, +"startColumn": 59, +"endLine": 687, +"endColumn": 67 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sql.Common\Snapshot\SqlSnapshotStore.cs", +"region": { +"startLine": 203, +"startColumn": 61, +"endLine": 203, +"endColumn": 69 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S6566.json new file mode 100644 index 00000000000..9a274f58dfa --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Persistence.Sqlite--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\contrib\persistence\Akka.Persistence.Sqlite\Snapshot\SqliteSnapshotStore.cs", +"region": { +"startLine": 88, +"startColumn": 29, +"endLine": 88, +"endColumn": 61 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Persistence.TCK--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Persistence.TCK--netstandard2.0-S6566.json new file mode 100644 index 00000000000..547c1094921 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Persistence.TCK--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Persistence.TCK\Snapshot\SnapshotStoreSpec.cs", +"region": { +"startLine": 119, +"startColumn": 99, +"endLine": 119, +"endColumn": 119 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S6566.json new file mode 100644 index 00000000000..5b44f7871db --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Remote--netstandard2.0-S6566.json @@ -0,0 +1,56 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\Deadline.cs", +"region": { +"startLine": 31, +"startColumn": 26, +"endLine": 31, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\Deadline.cs", +"region": { +"startLine": 39, +"startColumn": 26, +"endLine": 39, +"endColumn": 34 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\Deadline.cs", +"region": { +"startLine": 55, +"startColumn": 56, +"endLine": 55, +"endColumn": 64 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Remote\Deadline.cs", +"region": { +"startLine": 89, +"startColumn": 37, +"endLine": 89, +"endColumn": 45 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S6566.json new file mode 100644 index 00000000000..b592a81b2ef --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Streams--netstandard2.0-S6566.json @@ -0,0 +1,251 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Restart.cs", +"region": { +"startLine": 603, +"startColumn": 47, +"endLine": 603, +"endColumn": 55 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Dsl\Restart.cs", +"region": { +"startLine": 605, +"startColumn": 65, +"endLine": 605, +"endColumn": 73 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Extra\Timed.cs", +"region": { +"startLine": 296, +"startColumn": 36, +"endLine": 296, +"endColumn": 44 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\Ops.cs", +"region": { +"startLine": 3237, +"startColumn": 90, +"endLine": 3237, +"endColumn": 98 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Fusing\Ops.cs", +"region": { +"startLine": 3267, +"startColumn": 34, +"endLine": 3267, +"endColumn": 42 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 212, +"startColumn": 33, +"endLine": 212, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 220, +"startColumn": 33, +"endLine": 220, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 234, +"startColumn": 37, +"endLine": 234, +"endColumn": 45 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 295, +"startColumn": 33, +"endLine": 295, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 304, +"startColumn": 33, +"endLine": 304, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 322, +"startColumn": 56, +"endLine": 322, +"endColumn": 64 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 383, +"startColumn": 33, +"endLine": 383, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 416, +"startColumn": 37, +"endLine": 416, +"endColumn": 45 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 423, +"startColumn": 58, +"endLine": 423, +"endColumn": 66 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 589, +"startColumn": 33, +"endLine": 589, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 597, +"startColumn": 33, +"endLine": 597, +"endColumn": 41 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 626, +"startColumn": 32, +"endLine": 626, +"endColumn": 40 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 641, +"startColumn": 28, +"endLine": 641, +"endColumn": 36 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams\Implementation\Timers.cs", +"region": { +"startLine": 645, +"startColumn": 37, +"endLine": 645, +"endColumn": 45 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S6566.json new file mode 100644 index 00000000000..36b3a3b878c --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Streams.TestKit--netstandard2.0-S6566.json @@ -0,0 +1,30 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams.TestKit\TestSubscriber.cs", +"region": { +"startLine": 490, +"startColumn": 32, +"endLine": 490, +"endColumn": 40 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Streams.TestKit\TestSubscriber.cs", +"region": { +"startLine": 498, +"startColumn": 86, +"endLine": 498, +"endColumn": 94 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S6566.json b/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S6566.json new file mode 100644 index 00000000000..e6e9a79b496 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.TestKit--netstandard2.0-S6566.json @@ -0,0 +1,17 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.TestKit\TestKitBase.cs", +"region": { +"startLine": 235, +"startColumn": 70, +"endLine": 235, +"endColumn": 78 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/Akka.Tests.Performance--netcoreapp3.1-S6566.json b/analyzers/its/expected/akka.net/Akka.Tests.Performance--netcoreapp3.1-S6566.json new file mode 100644 index 00000000000..64d3e5f4198 --- /dev/null +++ b/analyzers/its/expected/akka.net/Akka.Tests.Performance--netcoreapp3.1-S6566.json @@ -0,0 +1,30 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Tests.Performance\IO\TcpHorizontalScaleSpec.cs", +"region": { +"startLine": 147, +"startColumn": 27, +"endLine": 147, +"endColumn": 35 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\core\Akka.Tests.Performance\IO\TcpHorizontalScaleSpec.cs", +"region": { +"startLine": 148, +"startColumn": 20, +"endLine": 148, +"endColumn": 28 +} +} +} +] +} diff --git a/analyzers/its/expected/akka.net/PersistenceBenchmark--net471-S6566.json b/analyzers/its/expected/akka.net/PersistenceBenchmark--net471-S6566.json new file mode 100644 index 00000000000..14ef11c69cd --- /dev/null +++ b/analyzers/its/expected/akka.net/PersistenceBenchmark--net471-S6566.json @@ -0,0 +1,30 @@ +{ +"issues": [ +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\benchmark\PersistenceBenchmark\Messages.cs", +"region": { +"startLine": 49, +"startColumn": 25, +"endLine": 49, +"endColumn": 33 +} +} +}, +{ +"id": "S6566", +"message": "Prefer using "DateTimeOffset" instead of "DateTime"", +"location": { +"uri": "sources\akka.net\src\benchmark\PersistenceBenchmark\Messages.cs", +"region": { +"startLine": 54, +"startColumn": 25, +"endLine": 54, +"endColumn": 33 +} +} +} +] +} diff --git a/analyzers/rspec/cs/S6566.html b/analyzers/rspec/cs/S6566.html new file mode 100644 index 00000000000..1063789052f --- /dev/null +++ b/analyzers/rspec/cs/S6566.html @@ -0,0 +1,48 @@ +
This rule recommends using DateTimeOffset
instead of DateTime
for projects targeting .NET Framework 2.0 or later.
You should use DateTimeOffset
instead of DateTime
as it provides all the information that the DateTime
+struct has, and additionally, the offset from Coordinated Universal Time (UTC). This way you can avoid potential problems created by the lack of
+timezone awareness (see the "Pitfalls" section below for more information).
However, it’s important to note that although DateTimeOffset
contains more information than DateTime
by storing the
+offset to UTC, it isn’t tied to a specific time zone. This information must be stored separately to have a full picture of the moment in time with the
+use of TimeZoneInfo
.
In most cases, you can directly replace DateTime
with DateTimeOffset
. When hardcoding dates with local kind, remember
+that the offset is timezone dependent, so it should be set according to which timezone that data represents. For more information, refer to
+DateTime
and DateTimeOffset
documentation from Microsoft (see the "Resources" section below).
+DateTime myDate = new DateTime(2008, 6, 19, 7, 0, 0, DateTimeKind.Local); // Noncompliant + +var now = DateTime.Now; // Noncompliant ++
+DateTimeOffset myDate = new DateTimeOffset(2008, 6, 19, 7, 0, 0, TimeSpan.FromHours(-7)); // Compliant + +var now = DateTimeOffset.Now; // Compliant ++
Common DateTime
pitfalls include:
DateTime
of kind Local
consider the time offset of the machine where the program is running. Not
+ storing the offset from UTC separately can result in meaningless data when retrieved from a different location. DateTime
of kind Unknown
, calling ToUniversalTime()
presumes the
+ DateTime.Kind
is local and converts to UTC, if you call the method ToLocalTime()
, it assumes the
+ DateTime.Kind
is UTC and converts it to local. DateTimes
objects, the user must ensure they are within the same time zone. DateTime
doesn’t consider
+ UTC/Local when comparing; it only cares about the number of Ticks
on the objects. This rule recommends using DateTimeOffset
instead of DateTime
for projects targeting .NET Framework 2.0 or later.
You should use DateTimeOffset
instead of DateTime
as it provides all the information that the DateTime
+struct has, and additionally, the offset from Coordinated Universal Time (UTC). This way you can avoid potential problems created by the lack of
+timezone awareness (see the "Pitfalls" section below for more information).
However, it’s important to note that although DateTimeOffset
contains more information than DateTime
by storing the
+offset to UTC, it isn’t tied to a specific time zone. This information must be stored separately to have a full picture of the moment in time with the
+use of TimeZoneInfo
.
In most cases, you can directly replace DateTime
with DateTimeOffset
. When hardcoding dates with local kind, remember
+that the offset is timezone dependent, so it should be set according to which timezone that data represents. For more information, refer to
+DateTime
and DateTimeOffset
documentation from Microsoft (see the "Resources" section below).
+Dim myDate As DateTime = New DateTime(2008, 6, 19, 7, 0, 0, DateTimeKind.Local) ' Noncompliant + +Dim now = DateTime.Now ' Noncompliant ++
+Dim myDate As DateTimeOffset = New DateTimeOffset(2008, 6, 19, 7, 0, 0, TimeSpan.FromHours(-7)) ' Compliant + +Dim now = DateTimeOffset.Now ' Compliant ++
Common DateTime
pitfalls include:
DateTime
of kind Local
consider the time offset of the machine where the program is running. Not
+ storing the offset from UTC separately can result in meaningless data when retrieved from a different location. DateTime
of kind Unknown
, calling ToUniversalTime()
presumes the
+ DateTime.Kind
is local and converts to UTC, if you call the method ToLocalTime()
, it assumes the
+ DateTime.Kind
is UTC and converts it to local. DateTimes
objects, the user must ensure they are within the same time zone. DateTime
doesn’t consider
+ UTC/Local when comparing; it only cares about the number of Ticks
on the objects.