HighlightSeverity (@Nullable RefEntity entity, @Nullable PsiElement psiElement, @NotNull InspectionToolResultExporter presentation) { HighlightSeverity severity = null; final InspectionProfile profile = InspectionProjectProfileManager.getInstance(presentation.getProject()).getCurrentProfile(); if (entity instanceof RefElement refElement) { severity = presentation.getSeverity(refElement); } if (severity == null) { String shortName = presentation.getToolWrapper().getShortName(); severity = profile.getErrorLevel(HighlightDisplayKey.find(shortName), psiElement).getSeverity(); } return severity; }