Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule S6588: Use DateTime(Offset).UnixEpoch instead of pointing to that date using the constructor #7080

Closed
2 tasks
mary-georgiou-sonarsource opened this issue Apr 14, 2023 · 1 comment · Fixed by #7509
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: New Feature This hasn't been here before.
Projects
Milestone

Comments

@mary-georgiou-sonarsource
Copy link
Contributor

Implement new rule S6588: Use DateTime(Offset).UnixEpoch instead of pointing to that date using the constructor.

This rule should raise when a new DateTime, DateTimeOffset or DateOnly object is created with Date 1-1-1970.

  • Implement Rule S6588 for C#
  • Implement Rule S6588 for VB.NET
@mary-georgiou-sonarsource mary-georgiou-sonarsource added Type: New Feature This hasn't been here before. Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Apr 14, 2023
@csaba-sagi-sonarsource csaba-sagi-sonarsource changed the title New rule S6588: Use DateTime(Offset).UnixEpoch instead of pointing to that date using the constructor New rule S6588: Use DateTime(Offset).UnixEpoch instead of pointing to that date using the constructor Apr 14, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from To do to In progress in Best Kanban Jun 26, 2023
@csaba-sagi-sonarsource
Copy link
Contributor

The rule should not cover DateOnly, because it does not have a UnixEpoch field that could be used instead.

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from Review approved to Review in progress in Best Kanban Jun 29, 2023
@github-actions github-actions bot moved this from Review in progress to Review approved in Best Kanban Jun 29, 2023
Best Kanban automation moved this from Review approved to Validate Peach Jun 29, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource moved this from Validate Peach to Done in Best Kanban Jun 30, 2023
@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource added this to the 9.5 milestone Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: New Feature This hasn't been here before.
Projects
Best Kanban
  
Done
4 participants