public MyVisitor(@NotNull ProblemsHolder holder) { myHolder = holder; InspectionProfile profile = InspectionProjectProfileManager.getInstance(holder.getProject()).getInspectionProfile(); UnusedDeclarationInspectionBase tool = (UnusedDeclarationInspectionBase) profile.getUnwrappedTool( UnusedDeclarationInspectionBase.SHORT_NAME, holder.getFile()); myDeadCodeInspection = tool == null ? new UnusedDeclarationInspectionBase() : tool; }
private static void checkMagicParameterArgument( @NotNull PsiParameter parameter, PsiExpression argument, @NotNull AllowedValues allowedValues, @NotNull ProblemsHolder holder) { final PsiManager manager = PsiManager.getInstance(holder.getProject()); if (!argument.getTextRange().isEmpty() && !isAllowed(parameter.getDeclarationScope(), argument, allowedValues, manager)) { registerProblem(argument, allowedValues, holder); } }