generateReport method

DiagnosticReport generateReport({
  1. required List<DiagnosticResult> results,
  2. String? projectName,
  3. String? projectPath,
  4. String? firebaseVersion,
  5. Map<String, String>? environment,
  6. bool computeHealthScore = true,
})

Implementation

DiagnosticReport generateReport({
  required List<DiagnosticResult> results,
  String? projectName,
  String? projectPath,
  String? firebaseVersion,
  Map<String, String>? environment,
  bool computeHealthScore = true,
}) {
  var report = DiagnosticReport(
    projectName: projectName ?? 'unknown',
    projectPath: projectPath ?? '',
    createdAt: DateTime.now(),
    results: results,
    firebaseVersion: firebaseVersion,
    environment: environment ?? {},
  );

  if (computeHealthScore) {
    report = report.computeHealthScore(engine: healthScoreEngine);
  }

  return report;
}