Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Latest commit

 

History

History
15 lines (8 loc) · 921 Bytes

README.md

File metadata and controls

15 lines (8 loc) · 921 Bytes

DateTimeNowAnalyzer

screen

Simple Analyzer for DateTime.Now, DateTime.UtcNow, DateTimeOffset.Now, DateTimeOffset.UtcNow.

Each of those static methods can lead to side-effects, that's why best practice is to have a top level abstraction for the project. This, for example, would allow to write unit tests with predictable results, without the need to deal with time accuracy.

DateTime.Now has way more issues than just being static mutable, but that's not really the goal of particular extension.

Plans for the future

Not much, probably wil port to VS 2017 when it's ready (or at least will start to work properly on my machine). Also have an idea to publish analyzer separately on nuget (not as VS extension), so it will work on .net core. The later is also a question of tooling, which is not ready yet.