bb-tools/proguard4.7/src/proguard/optimize/peephole/BranchTargetFinder.java
File BranchTargetFinder.java
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* ProGuard -- shrinking, optimization, obfuscation, and preverification
* of Java bytecode.
*
* Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
BranchTargetFinder
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class BranchTargetFinder
extends SimplifiedVisitor
implements AttributeVisitor,
InstructionVisitor,
ExceptionInfoVisitor,
Method visitCodeAttribute
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
{
// DEBUG =
// clazz.getName().equals("abc/Def") &&
// method.getName(clazz).equals("abc");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method visitCodeAttribute
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
{
// DEBUG =
// clazz.getName().equals("abc/Def") &&
// method.getName(clazz).equals("abc");
Method visitConstantInstruction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
{
// Mark the instruction.
instructionMarks[offset] |= INSTRUCTION;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
Open
if (opcode == InstructionConstants.OP_IRETURN ||
opcode == InstructionConstants.OP_LRETURN ||
opcode == InstructionConstants.OP_FRETURN ||
opcode == InstructionConstants.OP_DRETURN ||
opcode == InstructionConstants.OP_ARETURN ||
Method visitBranchInstruction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
Method visitVariableInstruction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
Method visitSimpleInstruction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
Method visitAnySwitchInstruction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
Method visitConstantInstruction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)