@Override
      public void visitParameter(@NotNull PsiParameter parameter) {
        PsiElement declarationScope = parameter.getDeclarationScope();
        boolean needToProcessParameter;
        if (declarationScope instanceof PsiMethod method) {
          needToProcessParameter = compareVisibilities(method, getParameterVisibility());
        }
        else if (declarationScope instanceof PsiLambdaExpression) {
          needToProcessParameter = compareVisibilities(
            PsiTreeUtil.getParentOfType(declarationScope, PsiModifierListOwner.class), getParameterVisibility());
        }
        else {
          needToProcessParameter = LOCAL_VARIABLE;
        }
        if (!needToProcessParameter) return;
        if (parameter.isUnnamed() || PsiUtil.isIgnoredName(parameter.getName())) return;
        QuickFixFactory quickFixFactory = QuickFixFactory.getInstance();
        if (declarationScope instanceof PsiMethod method) {
          if (PsiUtilCore.hasErrorElementChild(method)) return;
          if ((method.isConstructor() ||
               method.hasModifierProperty(PsiModifier.PRIVATE) ||
               method.hasModifierProperty(PsiModifier.STATIC) ||
               !method.hasModifierProperty(PsiModifier.ABSTRACT) &&
               (!isOverriddenOrOverrides(method) || shouldCheckParameterExcludingHierarchy())) &&
              !method.hasModifierProperty(PsiModifier.NATIVE) &&
              !JavaHighlightUtil.isSerializationRelatedMethod(method, method.getContainingClass()) &&
              !isUsedMainOrPremainMethod(method)) {
            if (UnusedSymbolUtil.isInjected(project, method)) return;
            String message = checkUnusedParameter(parameter);
            if (message != null) {
              registerProblem(
                parameter, message,
                ContainerUtil.append(
                  getFixesForUnusedParameter(method, parameter),
                  quickFixFactory.createRenameToIgnoredFix(parameter, true),
                  PriorityIntentionActionWrapper.highPriority(quickFixFactory.createSafeDeleteUnusedParameterInHierarchyFix(
                    parameter, shouldCheckParameterExcludingHierarchy() && isOverriddenOrOverrides(method)))));
            }
          }
        }
        else if (declarationScope instanceof PsiForeachStatement) {
          String message = checkUnusedParameter(parameter);
          if (message != null) {
            registerProblem(parameter, message, List.of(quickFixFactory.createRenameToIgnoredFix(parameter, false)));
          }
        }
        else if (parameter instanceof PsiPatternVariable variable) {
          String message = checkUnusedParameter(parameter);
          if (message != null) {
            PsiPattern pattern = variable.getPattern();
            IntentionAction action = null;
            if (PsiUtil.isAvailable(JavaFeature.UNNAMED_PATTERNS_AND_VARIABLES, parameter)) {
              if (pattern instanceof PsiTypeTestPattern ttPattern && pattern.getParent() instanceof PsiDeconstructionList) {
                PsiRecordComponent component = JavaPsiPatternUtil.getRecordComponentForPattern(pattern);
                PsiTypeElement checkType = ttPattern.getCheckType();
                if (component != null && checkType != null && checkType.getType().isAssignableFrom(component.getType())) {
                  action = new ReplaceWithUnnamedPatternFix(pattern).asIntention();
                }
              }
            }
            if (action == null && declarationScope.getParent() instanceof PsiSwitchBlock) {
              action = variable.getParent() instanceof PsiDeconstructionPattern
                       ? quickFixFactory.createDeleteFix(parameter)
                       : quickFixFactory.createRenameToIgnoredFix(parameter, false);
            }
            else if (!(pattern instanceof PsiTypeTestPattern && pattern.getParent() instanceof PsiDeconstructionList)) {
              action = quickFixFactory.createDeleteFix(parameter);
            }
            registerProblem(parameter, message, ContainerUtil.createMaybeSingletonList(action));
          }
        }
        else if ((shouldCheckParameterExcludingHierarchy() ||
                  PsiUtil.isAvailable(JavaFeature.UNNAMED_PATTERNS_AND_VARIABLES, declarationScope))
                 && declarationScope instanceof PsiLambdaExpression) {
          String message = checkUnusedParameter(parameter);
          if (message != null) {
            registerProblem(
              parameter, message,
              List.of(quickFixFactory.createRenameToIgnoredFix(parameter, true),
                      PriorityIntentionActionWrapper.lowPriority(
                        quickFixFactory.createSafeDeleteUnusedParameterInHierarchyFix(parameter, true))));
          }
        }
      }
@Override
      public void visitParameter(@NotNull PsiParameter parameter)