After running the standard analysis, you may want to look at the results for the following
analyses, as they highlight important properties of the analyzed code.
-
Classes with complex control flow
(Architecture > General Class-Level Information > Classes with complex control flow)
This analysis shows classes with complex control flow (deep nested loops and branches) as a heat map,
with complex classes showing in red and simpler classes showing in green. This allows you to
easily find the classes in your code that can potentially be a maintenance nightmare and
see if they could be simplified.
-
Ant target dependencies
(Architecture > General Top-Level Information > Ant target dependencies)
This analysis displays the dependencies of the targets in your ant files in a graph diagram,
with targets appearing as nodes connected by arrows to their dependencies. This enables you
to easily see the structure of your ant tasks, which can be difficult to see in code due
to lack of structure and tools for editing ant files.
-
Large Types
(Architecture > Refactoring Opportunities > Large types)
This analysis displays classes with a large number of lines of code. Classes that get too large
usually indicate that they can be refactored into smaller classes.
-
Array in String Append
(Violations of Best Practices > Undesirable Calls > Array in String append)
This analysis finds code that appends an array to a String. This will most likely produce
a result that is not what the author expected, with the resulting String containing
the object id of the array instead of its contents.
class A {
public static void main(String[] args) {
System.out.println("arguments: "+args);
}
}
-
Ignores exceptional return value
(Violations of Best Practices > Exception Handling > Ignores exceptional return value)
This analysis finds calls to common Java library functions like InputStream.read
that do not check the return value of the method. These are potential bugs as these methods
return the status of their result in the return value and ignoring them can lead to
an unexpected condition.
java.io.InputStream is = (...);
byte[] b = new byte[16];
is.read(b);