@Override
    public void visitIfStatement(@NotNull PsiIfStatement statement) {
      super.visitIfStatement(statement);

      if (ControlFlowUtils.isElseIf(statement)) return;
      PsiElement parent = statement.getParent();
      if (parent instanceof PsiIfStatement) return;
      if (parent instanceof PsiCodeBlock codeBlock && ArrayUtil.getFirstElement(codeBlock.getStatements()) == statement && 
          parent.getParent() instanceof PsiBlockStatement blockStatement && blockStatement.getParent() instanceof PsiIfStatement parentIf &&
          parentIf.getThenBranch() == blockStatement) {
        return;
      }

      final Set<PsiExpression> conditions = new LinkedHashSet<>();
      collectConditionsForIfStatementOrChain(statement, conditions, 0);
      if (conditions.size() >= 2) {
        findDuplicatesAccordingToSideEffects(conditions);
      }
      conditions.clear();
      collectConditionsForIfStatementAndChain(statement, conditions, 0);
      if (conditions.size() >= 2) {
        findDuplicatesAccordingToSideEffects(conditions);
      }
    }
@Override
    public void visitIfStatement(@NotNull PsiIfStatement statement)