Skip to content

FN S1449: DateTimeOffset, DateOnly and TimeOnly are not supported  #6439

Open
@mary-georgiou-sonarsource

Description

Description

The rule does not raise an issue for DateTimeOffset, DateOnly, and TimeOnly objects call ToString().

Repro steps

  var s = string.Empty;
  s = new DateTime().ToString(); // FN
  s = new DateTimeOffset().ToString(); // FN
  s = new TimeOnly().ToString(); // FN
  s = new DateOnly().ToString(); // FN

Expected behavior

An issue for S1449 should be raised.

Related information

  • C#/VB.NET Plugins version: 8.49

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: C#C# rules related issues.Type: False NegativeRule is NOT triggered when it should be.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions