The function should be renamed for clarity. Something like `DiagnosticUiAllowedForCurrentFile` (this also means you should invert the logic in the function).