@Override
  public @NotNull AnalyzerStatus getStatus() {
    // this method is rather expensive and PSI-related, need to execute in BGT and cache the result to show in EDT later
    ApplicationManager.getApplication().assertIsNonDispatchThread();
    ApplicationManager.getApplication().assertReadAccessAllowed();
    if (PowerSaveMode.isEnabled()) {
      return new AnalyzerStatus(AllIcons.General.InspectionsPowerSaveMode,
                                InspectionsBundle.message("code.analysis.is.disabled.in.power.save.mode"),
                                "",
                                myUIController).withState(InspectionsState.DISABLED);
    }
    DaemonCodeAnalyzerStatus status = getDaemonCodeAnalyzerStatus(mySeverityRegistrar);

    String title;
    String details;
    InspectionsState state;
    boolean isDumb = DumbService.isDumb(myProject);

    List<SeverityStatusItem> statusItems = new ArrayList<>();
    int[] errorCounts = status.errorCounts;
    for (int i = errorCounts.length - 1; i >= 0; i--) {
      int count = errorCounts[i];
      if (count > 0) {
        HighlightSeverity severity = mySeverityRegistrar.getSeverityByIndex(i);
        if (severity != null) {
          Icon icon = mySeverityRegistrar.getRendererIconBySeverity(severity, status.minimumLevel == FileHighlightingSetting.FORCE_HIGHLIGHTING);
          SeverityStatusItem next = new SeverityStatusItem(severity, icon, count, severity.getCountMessage(count));
          while (!statusItems.isEmpty()) {
            SeverityStatusItem merged = StatusItemMerger.runMerge(ContainerUtil.getLastItem(statusItems), next);
            if (merged == null) break;

            statusItems.remove(statusItems.size() - 1);
            next = merged;
          }
          statusItems.add(next);
        }
      }
    }

    if (status.errorAnalyzingFinished) {
      if (isDumb) {
        title = DaemonBundle.message("shallow.analysis.completed");
        details = DaemonBundle.message("shallow.analysis.completed.details");
        state = InspectionsState.SHALLOW_ANALYSIS_COMPLETE;
      }
      else if (myFileHighlightingSettings.containsValue(FileHighlightingSetting.ESSENTIAL)) {
        title = DaemonBundle.message("essential.analysis.completed");
        details = DaemonBundle.message("essential.analysis.completed.details");
        state = InspectionsState.ESSENTIAL_ANALYSIS_COMPLETE;
      }
      else {
        title = statusItems.isEmpty() ? DaemonBundle.message("no.errors.or.warnings.found") : "";
        details = "";
        state = InspectionsState.NO_PROBLEMS_FOUND;
      }
    }
    else {
      title = DaemonBundle.message("performing.code.analysis");
      details = "";
      state = InspectionsState.PERFORMING_CODE_ANALYSIS;
    }

    if (!statusItems.isEmpty()) {
      AnalyzerStatus result = new AnalyzerStatus(statusItems.get(0).getIcon(), title, "", myUIController).
        withNavigation(true).
        withState(state).
        withExpandedStatus(ContainerUtil.map(statusItems, i -> {
          TrafficLightStatusItemMetadata metadata = new TrafficLightStatusItemMetadata(i.getProblemCount(), i.getSeverity());
          return new StatusItem(Integer.toString(i.getProblemCount()), i.getIcon(), i.getCountMessage(), metadata);
        }));

      return status.errorAnalyzingFinished ? result :
             result.withAnalyzingType(AnalyzingType.PARTIAL).
             withPasses(ContainerUtil.map(status.passes, pass -> new PassWrapper(pass.getPresentableName(), toPercent(pass.getProgress(), pass.isFinished()))));
    }
    if (StringUtil.isNotEmpty(status.reasonWhyDisabled)) {
      return new AnalyzerStatus(AllIcons.General.InspectionsTrafficOff,
                                DaemonBundle.message("no.analysis.performed"),
                                status.reasonWhyDisabled, myUIController).withTextStatus(DaemonBundle.message("iw.status.off")).withState(InspectionsState.OFF);
    }
    if (StringUtil.isNotEmpty(status.reasonWhySuspended)) {
      return new AnalyzerStatus(AllIcons.General.InspectionsPause,
                                DaemonBundle.message("analysis.suspended"),
                                status.reasonWhySuspended, myUIController).
        withState(InspectionsState.PAUSED).
        withTextStatus(status.heavyProcessType != null ? status.heavyProcessType.toString() : DaemonBundle.message("iw.status.paused")).
        withAnalyzingType(AnalyzingType.SUSPENDED);
    }
    if (status.errorAnalyzingFinished) {
      Icon inspectionsCompletedIcon = status.minimumLevel == FileHighlightingSetting.FORCE_HIGHLIGHTING
                                      ? AllIcons.General.InspectionsOK
                                      : AllIcons.General.InspectionsOKEmpty;
      return isDumb ?
        new AnalyzerStatus(AllIcons.General.InspectionsPause, title, details, myUIController).
          withTextStatus(UtilBundle.message("heavyProcess.type.indexing")).
          withState(InspectionsState.INDEXING).
          withAnalyzingType(AnalyzingType.SUSPENDED) :
        new AnalyzerStatus(inspectionsCompletedIcon, title, details, myUIController);
    }

    return new AnalyzerStatus(AllIcons.General.InspectionsEye, DaemonBundle.message("no.errors.or.warnings.found"), details, myUIController).
      withTextStatus(DaemonBundle.message("iw.status.analyzing")).
      withState(InspectionsState.ANALYZING).
      withAnalyzingType(AnalyzingType.EMPTY).
      withPasses(ContainerUtil.map(status.passes, pass -> new PassWrapper(pass.getPresentableName(), toPercent(pass.getProgress(), pass.isFinished()))));
  }
@Override
  public @NotNull AnalyzerStatus getStatus()