Linter Demo Errors: 6Warnings: 5File: /home/fstrocco/Dart/dart/benchmark/koverage/lib/src/collect.dart // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library coverage.collect; import 'dart:async'; import 'devtools.dart'; import 'util.dart'; const _retryInterval = const Duration(milliseconds: 200); Future collect(String host, int port, bool resume, bool waitPaused, {Duration timeout}) async { var vmService = await retry( () => VMService.connect(host, port), _retryInterval, timeout: timeout); try { if (waitPaused) { await _waitIsolatesPaused(vmService, timeout: timeout); } return await _getAllCoverage(vmService); } finally { if (resume) { await _resumeIsolates(vmService); } await vmService.close(); } } Future _getAllCoverage(VMService service) async { var vm = await service.getVM(); var allCoverage = []; for (var isolateRef in vm.isolates) { var coverage = await service.getCoverage(isolateRef.id); allCoverage.addAll(coverage.coverage); } return {'type': 'CodeCoverage', 'coverage': allCoverage}; } Future _resumeIsolates(VMService service) async { var vm = await service.getVM(); for (var isolateRef in vm.isolates) { await service.resume(isolateRef.id); } } Future _waitIsolatesPaused(VMService service, {Duration timeout}) async { allPaused() async { var vm = await service.getVM(); for (var isolateRef in vm.isolates) { var isolate = await service.getIsolate(isolateRef.id); if (!isolate.paused) throw "Unpaused isolates remaining."; } } return retry(allPaused, _retryInterval, timeout: timeout); }