[ANN] InspectionGadgets 0.0.3 released

Announcing the release of InspectionGadgets 0.0.3, for all your static analysis needs. Available at
http://www.intellij.org/twiki/bin/view/Main/InspectionGadgets, and requires Aurora build 896. If there are any problems, don't hesitate to let me hear 'em.

New Configuration Option
-


"InspectionGadgets error highlighting" toggle under the "Options" menu allows on-line error highlighting
to be quickly disabled. This is handy when looking at source code from others that has large numbers of errors
which you don't intend to fix.

New inspections
-


Unnecessary temporary object on conversion from basic type to String
Unnecessary temporary object on conversion from String to basic type
Object allocation in loop
Abstract method overrides abstract method
Instance variable not initialized by readObject
Class total cyclomatic complexity
Class inheritance depth
Class nesting depth
Class constructor count
Class field count
Class method count

New inspection options
-



"Local variable naming convention" inspection now has an option to ignore for-loop parameters.
"Local variable naming convention" inspection now has an option to ignore catch block parameters.
"Parameteter name hides instance variable" inspection now has an option to ignore parameters of setter methods.
"Parameteter name hides instance variable" inspection now has an option to ignore parameters of constructors.
"Local variable name hides instance variable" inspection now has an option to ignore variables not visible from the current scope.
"Parameteter name hides instance variable" inspection now has an option to ignore variables not visible from the current scope.
"Field names hides superclass field" inspection now has an option to ignore variables not visible from the current scope.

Inspection removed
-


The inspection for if/for/while/do-while statements whose body is not wrapped in {} has been removed,
now that IDEA has (finally) been extended to do this automatically via "Reformat Code".

Bug fixes
-


"Hardcoded File Separators" now ignores common date format strings (thanks to Vilya Harvey for this code).
Fixed bug where the "Parameter Naming Convention" and "Parameter hides instance variable" inspections
check catch block parameters, instead of just method parameters
Fixed bug where the "Local Variable Naming Convention" and "Local variable hides instance variable" inspections
do not check catch block parameters
Inspections dealing with collections classes now work with the com.sun.java.lang.util collection classes.
Fixed bug in "overridable method call in constructor" that incorrectly flagged constructor calls to "this" and "super".
"String literal as argument to .equals()" now works on .equalsIgnoreCase() as well.
"Abstract method overrides concrete method" fixed to work correctly with interfaces

0

Dave,

Don't get me wrong. As I said in another post, it's absolutely fine with me (that people are posting issues, filing SCRs, that's a good thing IMO; anyway I'm not entitled to enforce anything). I'm just trying to say that maybe it's time to update the policy.


Timur

0


I like the flexibility of the Naming Convetions Inspections, but the downside is there is no QuickFixes.

It would be nice to have a 'Code Style Naming Conventions' which uses the IDEA Code Style Settings for Name Prefixes and Name Suffixes. A quick fix could be done for those.

I use 'm' prefix for field variables, and it would be useful to be able to enforce that naming conention across all the code.

0


My eventual plans are to have the quick-fix for naming convention problems be a trigger to the "Rename" refactoring, preloaded with a naming suggestion in some clever way. I'll certainly be using any prefix/suffix information in this preloading. The API for me to do this doesn't exist yet, but I do have a tracker item open.

--Dave Griffith

0

FYI

java.lang.NullPointerException

at
com.siyeh.ipp.trivialif.IfReturnImplicitToConditionalPredicate.satisfiedBy(IfReturnImplicitToConditionalPredicate.java:43)

at com.siyeh.ipp.Intention.findMatchingElement(Intention.java:109)

at com.siyeh.ipp.Intention.isAvailable(Intention.java:127)

at com.intellij.codeInsight.i.a.ce.c(ce.java:128)

at com.intellij.codeInsight.i.a.ce.b(ce.java:124)

at com.intellij.codeInsight.i.a.cn.run(cn.java:2)

at java.awt.event.InvocationEvent.dispatch(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at com.intellij.ide.s.a(s.java:61)

at com.intellij.ide.s.dispatchEvent(s.java:36)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)

0

请先登录再写评论。