boolean (@Nullable PsiExpression expression) { if (expression == null) { return false; } if (expression instanceof PsiReferenceExpression) { if (ignoreReferences) { return false; } } else if (expression instanceof PsiPolyadicExpression polyadicExpression) { if (ignoreComplexLiterals) { return false; } for (PsiExpression operand : polyadicExpression.getOperands()) { if (!checkExpression(operand)) { return false; } } } return true; }