void (@NotNull AnalysisScope scope, @NotNull CleanupProblems problems, @Nullable String commandName, @Nullable Runnable postRunnable, @NotNull InspectionProfile profile, boolean modal, @NotNull Predicate<? super ProblemDescriptor> shouldApplyFix) { if (problems.files().isEmpty()) { if (LOG.isDebugEnabled()) { LOG.debug("No problems found during code inspection, nothing to cleanup"); } if (commandName != null) { var notification = NOTIFICATION_GROUP.createNotification(InspectionsBundle.message("inspection.no.problems.message", scope.getFileCount(), scope.getDisplayName()), MessageType.INFO); if (!scope.isIncludeTestSource()) { addRepeatWithTestsAction(scope, notification, () -> codeCleanup(scope, profile, commandName, postRunnable, modal, shouldApplyFix)); } notification.notify(getProject()); } if (postRunnable != null) { postRunnable.run(); } return; } if (LOG.isDebugEnabled()) { LOG.debug("Applying fixes"); } if (!FileModificationService.getInstance().preparePsiElementsForWrite(problems.files())) return; CleanupInspectionUtil.getInstance().applyFixesNoSort( getProject(), LangBundle.message("code.cleanup"), problems.problemDescriptors(), null, false, problems.isGlobalScope()); if (postRunnable != null) { postRunnable.run(); } }