[Fb-contrib-commit] SF.net SVN: fb-contrib: [417] trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/det
Brought to you by:
dbrosius
From: <dbr...@us...> - 2006-04-08 22:37:29
|
Revision: 417 Author: dbrosius Date: 2006-04-08 15:37:22 -0700 (Sat, 08 Apr 2006) ViewCVS: http://svn.sourceforge.net/fb-contrib/?rev=417&view=rev Log Message: ----------- don't check small methods Modified Paths: -------------- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java Modified: trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java =================================================================== --- trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-08 14:24:57 UTC (rev 416) +++ trunk/fb-contrib/src/com/mebigfatguy/fbcontrib/detect/CyclomaticComplexity.java 2006-04-08 22:37:22 UTC (rev 417) @@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.Set; +import org.apache.bcel.classfile.Code; import org.apache.bcel.classfile.Method; import edu.umd.cs.findbugs.BugInstance; @@ -92,9 +93,15 @@ @Override public void visitMethod(final Method obj) { try { - if (obj.getCode() == null) + Code code = obj.getCode(); + if (code == null) return; + //There really is no valid relationship between reportLimit and code + //length, but it is good enough. If the method is small, don't bother + if (code.getCode().length < reportLimit) + return; + Set<Integer> exceptionNodeTargets = new HashSet<Integer>(); CFG cfg = classContext.getCFG(obj); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |