Skip to content

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

Closed
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    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