class AuthenticationService
{
private AccessTokenModel _lastTokenModel;
public DateTime? LastIssue { get; private set; }
public async Task<string> GetAccessToken()
{
if (LastIssue + _lastTokenModel?.ExpiresIn > DateTime.Now)
return _lastTokenModel.Token; // S2259: '_lastTokenModel' is null on at least one execution path.
Please stop propagating such false alerts. (It looks like you’re not familiar with the C#. We have a lot more false alerts! You’d better improve your issue detection otherwise we need to deactivate so many rules that Sonarcloud doesn’t make sense at all!)
The topics discussed here matter to us, and we want you to act as if they matter to you, too. Be respectful of the topics and the people discussing them, even if you disagree with some of what is being said.
Your feedback is valuable to us, but it must also be respectful.
and consider it as the opposite of Sonarcloud’s S2259 warning. I apologize for my rudeness and will check any future false-positives assumptions more carefully.