MetricsThresholds.fromMap constructor

MetricsThresholds.fromMap(
  1. Map<String, dynamic> map
)

Creates from a map.

Implementation

factory MetricsThresholds.fromMap(Map<String, dynamic> map) {
  return MetricsThresholds(
    cyclomaticComplexity:
        _parseInt(map['cyclomatic-complexity'], defaultValue: 20),
    cognitiveComplexity:
        _parseInt(map['cognitive-complexity'], defaultValue: 15),
    sourceLinesOfCode:
        _parseInt(map['source-lines-of-code'], defaultValue: 50),
    maintainabilityIndex:
        _parseInt(map['maintainability-index'], defaultValue: 50),
    maximumNesting: _parseInt(map['maximum-nesting'], defaultValue: 5),
    numberOfParameters:
        _parseInt(map['number-of-parameters'], defaultValue: 4),
    numberOfMethods: _parseInt(map['number-of-methods'], defaultValue: 20),
    halsteadVolume: _parseInt(map['halstead-volume'], defaultValue: 150),
  );
}