# Class Metrics::CompilationUnitMetrics

## Direct supertypes

## Indirect supertypes

## Predicates

getCyclomaticComplexity | Get the average Cyclomatic Complexity of the programs in this compilation unit. |

getMetrics | Get the metrics for this unit |

getSEIMaintainabilityIndex | Get the SEI Maintainability Index for this compilation unit. M = 171 - 5.2 * ln(V) - 0.23 * G - 16.2 * ln (LOC) + 50 * sin (sqrt(2.4 * CM)) |

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 | from ProgramDefinition_ |

getASuccessor | Get any possible successor in the progam’s control flow. | from AstNode |

getDataDivision | Get the data division of this | 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 | 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 | from Unit_ |

getIdentificationDivision | Get the identification division of this | 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 |

getParent | from Unit_ | |

getProcedureDivision | Get the procedure division of this | 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 | from ProgramDefinition_ |

getSourceUnitsList | Get the list of source units belonging to this | 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 |