FileMaintainabilityResult class

Result of maintainability calculation for an entire file.

Aggregates MaintainabilityResult for all functions and methods in a file. Use needsAttention to identify functions that require refactoring.

Example:

final calculator = MaintainabilityIndexCalculator();
final result = calculator.calculateForFile(compilationUnit);
for (final fn in result.needsAttention) {
  print('${fn.key}: MI=${fn.value.maintainabilityIndex}');
}

Constructors

FileMaintainabilityResult({required Map<String, MaintainabilityResult> functions, required double averageMaintainabilityIndex, required MaintainabilityRating rating})
const

Properties

averageMaintainabilityIndex double
Average MI across all functions in the file.
final
functions Map<String, MaintainabilityResult>
Map of function/method names to their maintainability results.
final
hashCode int
The hash code for this object.
no setterinherited
needsAttention Iterable<MapEntry<String, MaintainabilityResult>>
Returns functions that need attention (MI < 50).
no setter
rating MaintainabilityRating
Rating based on averageMaintainabilityIndex.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited