void (@NotNull final PsiElement element) { if (element instanceof ScopeOwner) { final ControlFlow flow = ControlFlowCache.getControlFlow((ScopeOwner)element); final Instruction[] instructions = flow.getInstructions(); final List<PsiElement> unreachable = new ArrayList<>(); if (instructions.length > 0) { ControlFlowUtil.iteratePrev(instructions.length - 1, instructions, instruction -> { if (instruction.allPred().isEmpty() && !PyInspectionsUtil.isFirstInstruction(instruction)) { unreachable.add(unwrapStatementListContainer(instruction.getElement())); } return ControlFlowUtil.Operation.NEXT; }); } for (PsiElement e : unreachable) { registerProblem(e, PyPsiBundle.message("INSP.unreachable.code")); } } }