1 26 27 package net.sourceforge.groboutils.codecoverage.v2.module; 28 29 30 import net.sourceforge.groboutils.codecoverage.v2.IAnalysisMetaData; 31 import net.sourceforge.groboutils.codecoverage.v2.IAnalysisModule; 32 import net.sourceforge.groboutils.codecoverage.v2.IMethodCode; 33 34 35 45 public class FunctionMeasure implements IAnalysisModule 46 { 47 50 public String getMeasureName() 51 { 52 return "Function"; 53 } 54 55 58 public String getMeasureUnit() 59 { 60 return "functions"; 61 } 62 63 64 68 public String getMimeEncoding() 69 { 70 return "text/plain"; 71 } 72 73 74 77 public void analyze( IMethodCode method ) 78 { 79 IAnalysisMetaData amd = createAnalysisMetaData( 80 method.getClassName(), method.getMethodName() ); 81 method.markInstruction( 0, amd ); 82 } 83 84 85 private IAnalysisMetaData createAnalysisMetaData( String clazz, 86 String method ) 87 { 88 return new DefaultAnalysisMetaData( 89 "Method "+method+" in class "+clazz, 90 "Didn't ever invoke method "+method+" in class "+clazz+".", 91 (byte)0 ); 92 } 93 } 94 95 | Popular Tags |