boolean (@NotNull PsiStatement @NotNull [] statements, PsiVariable variable) { SideEffectsVisitor visitor = new SideEffectsVisitor(statements, variable); for (PsiStatement statement : statements) { statement.accept(visitor); if (visitor.found) return true; } if (visitor.hasSimilarUseOfOutputInsideAndOutside(variable)) return true; return false; }