|
InspectorGeneral:
Powerful heuristic code improvement and bug-finding engine
Built
on IntelliJ IDEA's best-of-breed infrastructure of automated refactoring and code analysis, InspectorGeneral
takes them to the next level, providing over two hundred fully-automated code improvement rules, available
at a keystroke. To our knowlege, InspectorGeneral is the most powerful and easy-to-use automated code improvement
tool available.
Highlights of InspectorGeneral include
Control Flow Rationalization: Over a hundred rules for simplifying overly complex control flows, including
- Simplify complex boolean operations
- Remove "jumps to jumps"
- Merge parallel conditional branches
- Remove redundant local variables and unnecessary assignments
- Replace or and while loops by the new JDK 1.5 for-each loops
- Replace complex loop-breaking flows with simpler constructs
- Replace complex nested if statements used as guards with early returns
Access Modifier Tightening: Encapsulation is key to software development sanity, and InspectorGeneral makes
encapsulation trivial
- Mark classes, fields, and methods "private", "protected" or package-local, where possible
- Mark inner classes, fields, and methods "static", where possible
- Mark fields, methods, and classes final if possible
- Mark variables and parameters as final, or removing unnecessary final annotations
- Annotate classes, methods, and fields with @Override and @Deprecated, as appropriate
Nullity Annotations Inference: IntelliJ IDEA pioneered the idea of allowing developers to declare the potential nullity
of their fields, methods, and parameters, with the powerful @NotNull and @Nullable annotations. InspectorGeneral
takes that one step further, allowing nullity specifications to be automatically inferred and applied to your code.
NullPointerExceptions can be found at edit time, and with no more than the touch of a button.
References and Declaration Normalizations: a grab-bag of automated code cleanups and improvements, to bring your code to
the
highest level of polish. One-click improvements include
- Replace fully qualified names with imports
- Remove unnecessary reference qualifiers
- Correctly sort modifiers
- Remove obsolete modifiers
- Modernize array declarations
- Remove redundant interface and superclass declarations
All of this functionality is exposed via a simple and powerful interface, in most cases taking literally
no more than a keystroke. With InspectorGeneral, developers can rationalize control flow or tighten access modifiers
as easily as they can reformat code or optimize imports today. All of the code improvement functionality can also be
automatically
triggered on version control check-in, so that your mainline code is always as clean and well-structured as possible.
Additionally, InspectorGeneral includes sixteen heuristic code anomaly detectors, implemented as inspections. Code
anomaly detectors go beyond simple inspections, which find code that is obviously buggy or breaks style guidelies.
Anomaly detectors can search your code base for the small redundancies and slightly broken symmetries that indicate
worrisome code. Exploiting a deep understanding of not just how Java works, but how it is commonly used,
InspectorGeneral's
anomaly detectors can point you to bugs that other static analysis tools couldn't possibly detect.
|