False Positive S3240 SonarQube requires applying ternary operator syntax when not needed?

No, It suggests you change your code like this:

app.UseExceptionHandler(app.Environment.IsDevelopment()
  ? "/development-error-action"
  : "/production-error-action");
1 Like