public class FullMethodInfo extends FullElementInfo<BasicMethodInfo> implements HasAggregatedMetrics, HasMetricsNode, TaggedPersistent, MethodInfo
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_METHOD_COMPLEXITY |
context, sharedInfo| Constructor and Description |
|---|
FullMethodInfo(FullClassInfo containingClass,
ContextSet context,
BasicMethodInfo methodInfo)
For method-in-class
|
FullMethodInfo(FullClassInfo containingClass,
int relativeDataIndex,
ContextSet context,
SourceInfo region,
MethodSignature signature,
boolean isTest,
String staticTestName,
boolean isLambda,
int complexity) |
FullMethodInfo(FullClassInfo containingClass,
int relativeDataIndex,
ContextSet context,
SourceInfo region,
MethodSignature signature,
boolean isTest,
String staticTestName,
boolean isLambda,
int complexity,
LanguageConstruct construct) |
FullMethodInfo(FullFileInfo containingFile,
ContextSet context,
BasicMethodInfo methodInfo)
For method-in-file
|
FullMethodInfo(FullMethodInfo containingMethod,
ContextSet context,
BasicMethodInfo methodInfo)
For method-in-method
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBranch(FullBranchInfo branch) |
void |
addClass(FullClassInfo classInfo) |
void |
addMethod(FullMethodInfo methodInfo) |
void |
addStatement(FullStatementInfo stmt) |
FullMethodInfo |
copy(FullClassInfo classAsParent) |
FullMethodInfo |
copy(FullFileInfo fileAsParent) |
FullMethodInfo |
copy(FullMethodInfo methodAsParent) |
void |
gatherSourceRegions(Set<SourceInfo> regions) |
int |
getAggregatedComplexity() |
int |
getAggregatedStatementCount() |
List<? extends ClassInfo> |
getAllClasses()
Returns list of all classes, including indirect descendants.
|
List<? extends MethodInfo> |
getAllMethods()
Returns list of all methods, including indirect descendants.
|
int |
getBranchCount() |
List<? extends BranchInfo> |
getBranches()
Returns list of branches
|
HasMetricsNode |
getChild(int i) |
String |
getChildType() |
List<? extends ClassInfo> |
getClasses()
Returns list of classes
|
ClassInfo |
getContainingClass()
Returns a class in which method is declared or
null if method (actually it will be a function
or procedure) is declared outside the class. |
FileInfo |
getContainingFile()
Returns a file in which this method is declared.
|
MethodInfo |
getContainingMethod()
Returns a method in which this method (an inner function actually) is declared or
null if method
is not nested inside other method. |
ContextSet |
getContextFilter()
Returns context filter for the entity, i.e set of custom statement/method contexts as well as Clover's built-in
code contexts.
|
int |
getDataLength() |
CoverageDataProvider |
getDataProvider() |
int |
getIndexOfChild(HasMetricsNode child) |
List<? extends MethodInfo> |
getMethods()
Returns list of methods
|
BlockMetrics |
getMetrics() |
String |
getName() |
int |
getNumChildren() |
EntityContainer |
getParent()
Returns an object which encloses this method.
|
String |
getQualifiedName() |
BlockMetrics |
getRawMetrics() |
MethodSignature |
getSignature()
Returns method signature (annotations, keywords, type parameters, method name, parameters, return type, throws).
|
String |
getSimpleName() |
List<? extends StatementInfo> |
getStatements()
Returns list of statements
|
String |
getStaticTestName()
Name of the test associated with a method.
|
String |
getVisibility()
convenience method
|
void |
increaseAggregatedComplexity(int increment) |
void |
increaseAggregatedStatementCount(int increment) |
boolean |
isEmpty()
Returns whether method is empty, i.e.
|
boolean |
isLambda()
Returns whether it's a lambda function or not.
|
boolean |
isLeaf() |
boolean |
isPublic()
convenience method
|
boolean |
isTest()
Returns whether it's a test method or not.
|
boolean |
isVoidReturnType() |
static FullMethodInfo |
read(TaggedDataInput in) |
void |
setAggregatedComplexity(int aggregatedComplexity) |
void |
setAggregatedStatementCount(int aggregatedStatementCount) |
void |
setComparator(Comparator cmp) |
protected void |
setContainingClass(FullClassInfo classInfo) |
protected void |
setContainingFile(FullFileInfo fileInfo) |
protected void |
setContainingMethod(FullMethodInfo methodInfo) |
void |
setDataLength(int length) |
void |
setDataProvider(CoverageDataProvider data) |
void |
setMetrics(BlockMetrics metrics) |
void |
setRegionEnd(int endLine,
int endCol) |
void |
setStaticTestName(String staticTestName) |
void |
setVoidReturnType(boolean voidReturnType) |
String |
toString() |
void |
visit(EntityVisitor entityVisitor)
Visit yourself
|
void |
visit(FileElementVisitor visitor) |
void |
write(TaggedDataOutput out) |
addContext, getComplexity, getConstruct, getContext, getDataIndex, getEndColumn, getEndLine, getHitCount, getRelativeDataIndex, getStartColumn, getStartLine, isFiltered, setComplexity, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComplexity, getContext, getHitCountgetEndColumn, getEndLine, getStartColumn, getStartLinegetDataIndexpublic static final int DEFAULT_METHOD_COMPLEXITY
public FullMethodInfo(FullClassInfo containingClass, int relativeDataIndex, ContextSet context, SourceInfo region, MethodSignature signature, boolean isTest, String staticTestName, boolean isLambda, int complexity)
public FullMethodInfo(FullClassInfo containingClass, int relativeDataIndex, ContextSet context, SourceInfo region, MethodSignature signature, boolean isTest, String staticTestName, boolean isLambda, int complexity, LanguageConstruct construct)
public FullMethodInfo(FullClassInfo containingClass, ContextSet context, BasicMethodInfo methodInfo)
public FullMethodInfo(FullMethodInfo containingMethod, ContextSet context, BasicMethodInfo methodInfo)
public FullMethodInfo(FullFileInfo containingFile, ContextSet context, BasicMethodInfo methodInfo)
public String getName()
getName in interface HasMetricsgetName in interface MethodInfopublic String getSimpleName()
getSimpleName in interface MethodInfo@NotNull public MethodSignature getSignature()
MethodInfogetSignature in interface MethodInfopublic String getQualifiedName()
getQualifiedName in interface MethodInfo@Nullable public ClassInfo getContainingClass()
MethodInfonull if method (actually it will be a function
or procedure) is declared outside the class.getContainingClass in interface MethodInfonull@Nullable public MethodInfo getContainingMethod()
MethodInfonull if method
is not nested inside other method.getContainingMethod in interface MethodInfonullpublic boolean isTest()
MethodInfoisTest in interface MethodInfo@Nullable public String getStaticTestName()
MethodInfogetStaticTestName in interface MethodInfonull if not declaredpublic boolean isLambda()
MethodInfoisLambda in interface MethodInfotrue for lambda function, false otherwisepublic boolean isEmpty()
MethodInfoisEmpty in interface MethodInfoisEmpty in interface HasMetricsNodepublic ContextSet getContextFilter()
HasContextFiltergetContextFilter in interface HasContextFilterpublic int getAggregatedStatementCount()
getAggregatedStatementCount in interface HasAggregatedMetricspublic void setAggregatedStatementCount(int aggregatedStatementCount)
setAggregatedStatementCount in interface HasAggregatedMetricspublic void increaseAggregatedStatementCount(int increment)
public int getAggregatedComplexity()
getAggregatedComplexity in interface HasAggregatedMetricspublic void setAggregatedComplexity(int aggregatedComplexity)
setAggregatedComplexity in interface HasAggregatedMetricspublic void increaseAggregatedComplexity(int increment)
public void addClass(FullClassInfo classInfo)
public void addMethod(FullMethodInfo methodInfo)
@NotNull public List<? extends ClassInfo> getClasses()
getClasses in interface HasClasses@NotNull public List<? extends ClassInfo> getAllClasses()
HasClassesgetAllClasses in interface HasClasses@NotNull public List<? extends MethodInfo> getMethods()
getMethods in interface HasMethods@NotNull public List<? extends MethodInfo> getAllMethods()
HasMethodsgetAllMethods in interface HasMethodspublic void addStatement(FullStatementInfo stmt)
public void addBranch(FullBranchInfo branch)
@NotNull public List<? extends StatementInfo> getStatements()
HasStatementsgetStatements in interface HasStatements@NotNull public List<? extends BranchInfo> getBranches()
HasBranchesgetBranches in interface HasBranchespublic int getBranchCount()
public BlockMetrics getMetrics()
getMetrics in interface HasMetricspublic BlockMetrics getRawMetrics()
getRawMetrics in interface HasMetricspublic void setMetrics(BlockMetrics metrics)
setMetrics in interface HasMetricspublic void setDataProvider(CoverageDataProvider data)
setDataProvider in interface CoverageDataReceptorpublic void gatherSourceRegions(Set<SourceInfo> regions)
public void visit(EntityVisitor entityVisitor)
visit in interface EntityContainerentityVisitor - callbackpublic void visit(FileElementVisitor visitor)
public boolean isLeaf()
isLeaf in interface HasMetricsNodepublic int getNumChildren()
getNumChildren in interface HasMetricsNodepublic String getChildType()
getChildType in interface HasMetricsNodepublic HasMetricsNode getChild(int i)
getChild in interface HasMetricsNodepublic int getIndexOfChild(HasMetricsNode child)
getIndexOfChild in interface HasMetricsNodepublic void setComparator(Comparator cmp)
setComparator in interface HasMetricsNodepublic FullMethodInfo copy(FullClassInfo classAsParent)
public FullMethodInfo copy(FullMethodInfo methodAsParent)
public FullMethodInfo copy(FullFileInfo fileAsParent)
public boolean isPublic()
public String getVisibility()
public CoverageDataProvider getDataProvider()
getDataProvider in interface CoverageDataReceptorpublic int getDataLength()
getDataLength in interface InstrumentationInfogetDataLength in interface CoverageDataRangepublic void setDataLength(int length)
protected void setContainingClass(FullClassInfo classInfo)
protected void setContainingMethod(FullMethodInfo methodInfo)
protected void setContainingFile(FullFileInfo fileInfo)
@Nullable public FileInfo getContainingFile()
MethodInfogetContainingFile in interface MethodInfogetContainingFile in interface FileInfoRegion@NotNull public EntityContainer getParent()
MethodInfoEntityVisitor.visitClass(ClassInfo) - for a method declared inside a classEntityVisitor.visitMethod(MethodInfo) - for a method declared inside another methodEntityVisitor.visitFile(FileInfo) - for a method declared in the file (on a top-level)getParent in interface HasParentgetParent in interface MethodInfopublic void setRegionEnd(int endLine,
int endCol)
public void setStaticTestName(String staticTestName)
public boolean isVoidReturnType()
public void setVoidReturnType(boolean voidReturnType)
public void write(TaggedDataOutput out) throws IOException
write in interface TaggedPersistentIOExceptionpublic static FullMethodInfo read(TaggedDataInput in) throws IOException
IOExceptionCopyright © 2024 OpenClover.org. All rights reserved.