@NotNull
  private static CommonProblemDescriptor createRerunGlobalToolDescriptor(@NotNull GlobalInspectionToolWrapper wrapper,
                                                                         @Nullable RefEntity entity,
                                                                         @NotNull OfflineProblemDescriptor offlineDescriptor,
                                                                         @NotNull Project project) {
    QuickFix<?> rerunFix = new QuickFix<>() {
      @Nls
      @NotNull
      @Override
      public String getFamilyName() {
        return InspectionsBundle.message("rerun.inspection.family.name", wrapper.getDisplayName());
      }

      @Override
      public void applyFix(@NotNull Project project, @NotNull CommonProblemDescriptor descriptor) {
        VirtualFile file = null;
        if (entity != null && entity.isValid() && entity instanceof RefElement) {
          file = ((RefElement)entity).getPointer().getVirtualFile();
        }
        PsiFile psiFile = null;
        if (file != null) {
          psiFile = PsiManager.getInstance(project).findFile(file);
        }
        RunInspectionAction.runInspection(project, wrapper.getShortName(), file, null, psiFile);
      }

      @Override
      public boolean startInWriteAction() {
        return false;
      }
    };
    List<String> hints = offlineDescriptor.getHints();
    if (hints != null && entity instanceof RefModule) {
      List<QuickFix> fixes = ContainerUtil.mapNotNull(hints, hint -> wrapper.getTool().getQuickFix(hint));
      return InspectionManager.getInstance(project).createProblemDescriptor(offlineDescriptor.getDescription(), ((RefModule)entity).getModule(), ArrayUtil.append(fixes.toArray(QuickFix.EMPTY_ARRAY), rerunFix));
    }
    return InspectionManager.getInstance(project).createProblemDescriptor(offlineDescriptor.getDescription(), rerunFix);
  }
@NotNull
  private static CommonProblemDescriptor createRerunGlobalToolDescriptor(@NotNull GlobalInspectionToolWrapper wrapper,
                                                                         @Nullable RefEntity entity,
                                                                         @NotNull OfflineProblemDescriptor offlineDescriptor,
                                                                         @NotNull Project project)