Lcov constructor

Lcov({
  1. required Config config,
  2. required List<Record> records,
})

Lcov constructor

Implementation

Lcov({required this.config, required this.records}) {
  try {
    coverage = Coverage(config.percentage);

    records =
        records.where((element) => !hasSuffix(element.file ?? '')).toList();

    records.forEach(updateTotals);

    final totalCoverage = (totalHits / totalFinds) * 100;
    coverage.totalCoverage = totalCoverage;
  } on FileSystemException catch (e) {
    print(AppConstants.fileSystemExceptionMessage);
    print(e);
    rethrow;
  } catch (e) {
    print(e);
    rethrow;
  }
}