OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Summarizes the information produced by the checker. | 5 /// Summarizes the information produced by the checker. |
6 library dev_compiler.src.report; | 6 library dev_compiler.src.report; |
7 | 7 |
8 import 'dart:math' show max; | 8 import 'dart:math' show max; |
9 | 9 |
10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 /// Add a column with the given [name]. | 197 /// Add a column with the given [name]. |
198 void declareColumn(String name, {bool abbreviate: false}) { | 198 void declareColumn(String name, {bool abbreviate: false}) { |
199 assert(!_sealed); | 199 assert(!_sealed); |
200 var headerName = name; | 200 var headerName = name; |
201 if (abbreviate) { | 201 if (abbreviate) { |
202 // abbreviate the header by using only the capital initials. | 202 // abbreviate the header by using only the capital initials. |
203 headerName = name.replaceAll(new RegExp('[a-z]'), ''); | 203 headerName = name.replaceAll(new RegExp('[a-z]'), ''); |
204 while (abbreviations[headerName] != null) headerName = "$headerName'"; | 204 while (abbreviations[headerName] != null) headerName = "$headerName'"; |
205 abbreviations[headerName] = name; | 205 abbreviations[headerName] = name; |
206 } | 206 } |
207 widths.add(max(5, headerName.length + 1)); | 207 widths.add(max(5, headerName.length + 1) as int); |
208 header.add(headerName); | 208 header.add(headerName); |
209 _totalColumns++; | 209 _totalColumns++; |
210 } | 210 } |
211 | 211 |
212 /// Add an entry in the table, creating a new row each time [totalColumns] | 212 /// Add an entry in the table, creating a new row each time [totalColumns] |
213 /// entries are added. | 213 /// entries are added. |
214 void addEntry(entry) { | 214 void addEntry(entry) { |
215 if (_currentRow == null) { | 215 if (_currentRow == null) { |
216 _sealed = true; | 216 _sealed = true; |
217 _currentRow = []; | 217 _currentRow = []; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 311 |
312 visitMessage(MessageSummary message) { | 312 visitMessage(MessageSummary message) { |
313 var kind = message.kind; | 313 var kind = message.kind; |
314 errorCount.putIfAbsent(currentPackage, () => <String, int>{}); | 314 errorCount.putIfAbsent(currentPackage, () => <String, int>{}); |
315 errorCount[currentPackage].putIfAbsent(kind, () => 0); | 315 errorCount[currentPackage].putIfAbsent(kind, () => 0); |
316 errorCount[currentPackage][kind]++; | 316 errorCount[currentPackage][kind]++; |
317 totals.putIfAbsent(kind, () => 0); | 317 totals.putIfAbsent(kind, () => 0); |
318 totals[kind]++; | 318 totals[kind]++; |
319 } | 319 } |
320 } | 320 } |
OLD | NEW |