report method

  1. @override
Future<void> report(
  1. Iterable<UnusedCodeFileReport> records, {
  2. UnusedCodeReportParams? additionalParams,
})
override

Implementation

@override
Future<void> report(
  Iterable<UnusedCodeFileReport> records, {
  UnusedCodeReportParams? additionalParams,
}) async {
  if (records.isEmpty) {
    return;
  }

  final encodedReport = json.encode({
    'formatVersion': formatVersion,
    'timestamp': getTimestamp(),
    'unusedCode': records.map(_unusedCodeFileReportToJson).toList(),
  });

  output.write(encodedReport);
}