Source:
<code>private void visit(Tree tree, Tree terminator) { LOG.debug("visiting node " + tree.kind().name() + " at line " + ((JavaTree) tree).getLine()); switch (tree.kind()) { case LABELED_STATEMENT: case SWITCH_STATEMENT: case EXPRESSION_STATEMENT: case PARENTHESIZED_EXPRESSION: throw new IllegalStateException("Cannot appear in CFG: " + tree.kind().name()); case VARIABLE: VariableTree variableTree = (VariableTree) tree; ExpressionTree initializer = variableTree.initializer(); if (initializer == null) { if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { setSymbolicValueForEachValue(variableTree); } else if (variableTree.type().symbolType().is("boolean")) { setSymbolicValueFalseValue(variableTree); } else if (!variableTree.type().symbolType().isPrimitive()) { setSymbolicValueNullValue(variableTree); } } else { setSymbolicValueValueFromInitializer(variableTree, initializer); } break; <START> case ASSIGNMENT: <END> AssignmentExpressionTree assignmentExpressionTree = ((AssignmentExpressionTree) tree); if (assignmentExpressionTree.variable().is(Tree.Kind.IDENTIFIER)) { SymbolicValue value = getVal(assignmentExpressionTree.expression()); programState = put(programState, ((IdentifierTree) assignmentExpressionTree.variable()).symbol(), value); } break; case METHOD_INVOCATION: setSymbolicValueOnFields((MethodInvocationTree) tree); break; case IDENTIFIER: if (terminator != null && terminator.is(Tree.Kind.SYNCHRONIZED_STATEMENT)) { resetConstraintsOnFields(); } default: } checkerDispatcher.executeCheckPreStatement(tree); }</code><technical_language>![MAJOR](<LINK_1> Reduce this switch case number of lines 7 5, for example extracting code methods. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void visit(Tree tree, Tree terminator) { LOG.debug("visiting node " + tree.kind().name() + " at line " + ((JavaTree) tree).getLine()); switch (tree.kind()) { case LABELED_STATEMENT: case SWITCH_STATEMENT: case EXPRESSION_STATEMENT: case PARENTHESIZED_EXPRESSION: throw new IllegalStateException("Cannot appear in CFG: " + tree.kind().name()); case VARIABLE: VariableTree variableTree = (VariableTree) tree; ExpressionTree initializer = variableTree.initializer(); if (initializer == null) { if (terminator != null && terminator.is(Tree.Kind.FOR_EACH_STATEMENT)) { setSymbolicValueForEachValue(variableTree); } else if (variableTree.type().symbolType().is("boolean")) { setSymbolicValueFalseValue(variableTree); } else if (!variableTree.type().symbolType().isPrimitive()) { setSymbolicValueNullValue(variableTree); } } else { setSymbolicValueValueFromInitializer(variableTree, initializer); } break; case ASSIGNMENT: AssignmentExpressionTree assignmentExpressionTree = (AssignmentExpressionTree) tree; if (assignmentExpressionTree.variable().is(Tree.Kind.IDENTIFIER)) { SymbolicValue value = getVal(assignmentExpressionTree.expression()); programState = put(programState, ((IdentifierTree) assignmentExpressionTree.variable()).symbol(), value); } break; case METHOD_INVOCATION: setSymbolicValueOnFields((MethodInvocationTree) tree); break; case IDENTIFIER: if (terminator != null && terminator.is(Tree.Kind.SYNCHRONIZED_STATEMENT)) { resetConstraintsOnFields(); } break; default: } checkerDispatcher.executeCheckPreStatement(tree); }