void readExternal(@NotNull Element toolElement, @NotNull InspectionProfileManager profileManager, @Nullable Map<? super String, List<String>> dependencies) {
    String levelName = toolElement.getAttributeValue(LEVEL_ATTRIBUTE);
    SeverityRegistrar registrar = profileManager.getSeverityRegistrar();
    HighlightDisplayLevel level;
    HighlightSeverity severity = levelName == null ? null : registrar.getSeverity(levelName);
    level = severity == null ? null : HighlightDisplayLevel.find(severity);
    if (level == null) {
      level = HighlightDisplayLevel.WARNING;
    }
    myDefaultState.setLevel(level);
    InspectionToolWrapper<?,?> toolWrapper = myDefaultState.getTool();
    String editorAttributes = toolElement.getAttributeValue("editorAttributes");
    if (editorAttributes != null) {
      myDefaultState.setEditorAttributesExternalName(editorAttributes);
    }
    String enabled = toolElement.getAttributeValue(ENABLED_ATTRIBUTE);
    boolean isEnabled = Boolean.parseBoolean(enabled);

    String enabledTool = toolElement.getAttributeValue(ENABLED_BY_DEFAULT_ATTRIBUTE);
    myDefaultState.setEnabled(enabledTool != null ? Boolean.parseBoolean(enabledTool) : isEnabled);

    List<Element> scopeElements = toolElement.getChildren(ProfileEx.SCOPE);
    if (!scopeElements.isEmpty()) {
      List<String> scopeNames = new SmartList<>();
      for (Element scopeElement : scopeElements) {
        String scopeName = scopeElement.getAttributeValue(ProfileEx.NAME);
        if (scopeName == null) {
          continue;
        }
        NamedScopesHolder scopesHolder = profileManager.getScopesManager();
        NamedScope namedScope = null;
        if (scopesHolder != null) {
          namedScope = scopesHolder.getScope(scopeName);
        }
        String errorLevel = scopeElement.getAttributeValue(LEVEL_ATTRIBUTE);
        String enabledInScope = scopeElement.getAttributeValue(ENABLED_ATTRIBUTE);
        InspectionToolWrapper<?,?> copyToolWrapper = toolWrapper.createCopy();
        // check if unknown children exists
        if (scopeElement.getAttributes().size() > 3 || !scopeElement.getChildren().isEmpty()) {
          copyToolWrapper.getTool().readSettings(scopeElement);
        }
        HighlightSeverity errorSeverity = errorLevel == null ? null : registrar.getSeverity(errorLevel);
        HighlightDisplayLevel scopeLevel = errorSeverity == null ? null : HighlightDisplayLevel.find(errorSeverity);
        if (scopeLevel == null) {
          scopeLevel = level;
        }
        ScopeToolState state;
        if (namedScope != null) {
          state = addTool(namedScope, copyToolWrapper, Boolean.parseBoolean(enabledInScope), scopeLevel);
        }
        else {
          state = addTool(scopeName, copyToolWrapper, Boolean.parseBoolean(enabledInScope), scopeLevel);
        }

        editorAttributes = scopeElement.getAttributeValue("editorAttributes");
        if (editorAttributes != null) {
          state.setEditorAttributesExternalName(editorAttributes);
        }
        scopeNames.add(scopeName);
      }

      if (dependencies != null) {
        for (int i = 0; i < scopeNames.size(); i++) {
          String scopeName = scopeNames.get(i);
          List<String> order = dependencies.computeIfAbsent(scopeName, __ -> new ArrayList<>());
          for (int j = i + 1; j < scopeNames.size(); j++) {
            order.add(scopeNames.get(j));
          }
        }
      }
    }

    // check if unknown children exists
    if (toolElement.getAttributes().size() > 4 || toolElement.getChildren().size() > scopeElements.size()) {
      ScopeToolState.tryReadSettings(toolWrapper.getTool(), toolElement);
    }

    myEnabled = isEnabled;
  }
void readExternal(@NotNull Element toolElement, @NotNull InspectionProfileManager profileManager, @Nullable Map<? super String, List<String>> dependencies)