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

Fix S6588 FN: Rule should cover case with epoch ticks #7547

Closed
csaba-sagi-sonarsource opened this issue Jul 6, 2023 · 0 comments · Fixed by #7550
Closed

Fix S6588 FN: Rule should cover case with epoch ticks #7547

csaba-sagi-sonarsource opened this issue Jul 6, 2023 · 0 comments · Fixed by #7550
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues.
Milestone

Comments

@csaba-sagi-sonarsource
Copy link
Contributor

csaba-sagi-sonarsource commented Jul 6, 2023

Description

The rule should raise if the constructor is called with the ticks that are equal to the epoch ticks (621355968000000000).

const long EpochTicks = 621355968000000000;

_ = new DateTime(621355968000000000); // Noncompliant
_ = new DateTime(EpochTicks); // Noncompliant

While doing the validation for rule S6562 I found examples like: _ = new DateTime(EPOCH);

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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants