Class Metrics::ProgramDefinitionMetrics

Direct supertypes

Indirect supertypes

Known direct subtypes

Predicates

getCyclomaticComplexity

Get the approximate Cyclomatic Complexity for this program. This is calculated for a single unit as E - N + 2 (where E and N are the number of edges and nodes in the control-flow graph respectively) and is closely approximated by PI + 1, where PI is the number of branch statements.

getMetrics

Get the metrics for this unit

toString

Inherited predicates

contains

true for a node that is contained within this program directly (not in a nested program)

from ProgramDefinition
getASourceUnit

Get a source units belonging to this ProgramDefinition.

from ProgramDefinition_
getASuccessor

Get any possible successor in the progam’s control flow.

from AstNode
getDataDivision

Get the data division of this ProgramDefinition.

from ProgramDefinition_
getEnclosingText

Get the unit containing this element.

from AstNode
getEnclosingUnit

Get the unit containing this element.

from AstNode
getEnvironmentDivision

Get the environment division of this ProgramDefinition.

from ProgramDefinition_
getFirstSourceUnit

Get the first source units in the list.

from ProgramDefinition_
getHalsteadDeliveredBugs

Get the Halstead ‘delivered bugs’ metric for this unit. This metric correlates with the complexity of the software, but is known to be an underestimate of bug counts.

from UnitMetrics
getHalsteadDifficulty

Get the Halstead difficulty value of this unit. This is proportional to the number of unique operators, and further proportional to the ratio of total operands to unique operands.

from UnitMetrics
getHalsteadEffort

Get the Halstead implementation effort for this unit. This is the product of the volume and difficulty.

from UnitMetrics
getHalsteadLength

Get the Halstead length of this unit. This is the sum of the N1 and N2 Halstead metrics.

from UnitMetrics
getHalsteadN1

the total number of operators in this unit

from UnitMetrics
getHalsteadN2

the total number of operators in this unit

from UnitMetrics
getHalsteadVocabulary

Get the Halstead vocabulary size of this unit. This is the sum of the n1 and n2 Halstead metrics

from UnitMetrics
getHalsteadVolume

Get the Halstead volume of this unit. This is the Halstead size multiplied by the log of the Halstead vocabulary. It represents the information content of the function.

from UnitMetrics
getHalsteadn1Distinct

the number of distinct operators in this unit

from UnitMetrics
getHalsteadn2Distinct

the number of distinct operands in this unit

from UnitMetrics
getHeader

Get the header of this Unit.

from Unit_
getIdentificationDivision

Get the identification division of this ProgramDefinition.

from ProgramDefinition_
getLastSourceUnit

Get the last source units in the list.

from ProgramDefinition_
getLocation

Get this element’s location.

from Locatable
getNumLines

Get the number of lines covered by this element.

from Locatable
getNumberOfLines

the number of lines in this file

from SourceLine
getNumberOfLinesOfCode

the number of lines containing code in this file

from SourceLine
getNumberOfLinesOfComments

the number of lines containing comments in this file

from SourceLine
getNumberOfLinesOfWater

the number of lines containing water in this file

from SourceLine
getNumberOfStmts

the number of statements in this unit

from UnitMetrics
getParentfrom Unit_
getProcedureDivision

Get the procedure division of this ProgramDefinition.

from ProgramDefinition_
getProgramDefinition

Get the program definition containing this unit. If the unit is a program definition, return the unit itself.

from Unit
getSourceUnit

Get the nth source units of this ProgramDefinition.

from ProgramDefinition_
getSourceUnitsList

Get the list of source units belonging to this ProgramDefinition.

from ProgramDefinition_
getSourceUnitsSize

Get the number of elements in the list of source units.

from ProgramDefinition_
getStatementNestingDepth

Get the maximum nesting depth of statements in this unit.

from UnitMetrics
hasAncestor

Does this AstNode have ‘other’ as a ancestor?

from AstNode
hasDescendant

Does this AstNode have ‘other’ as a descendant?

from AstNode