Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: lib/src/report.dart

Issue 1059873002: Tweaks to warning level and reporting (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix up tests Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/info.dart ('k') | test/checker/checker_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/report.dart
diff --git a/lib/src/report.dart b/lib/src/report.dart
index 26c27b1a169bb28aa05998b3c3735542b3878c52..f76d61fd4b5344f54abbf92823c8a2a18f320123 100644
--- a/lib/src/report.dart
+++ b/lib/src/report.dart
@@ -198,7 +198,10 @@ String summaryToString(GlobalSummary summary) {
// Declare columns and add header
table.declareColumn('package');
table.declareColumn('AnalyzerError', abbreviate: true);
- infoTypes.forEach((type) => table.declareColumn('$type', abbreviate: true));
+ var activeInfoTypes =
+ infoTypes.where((type) => counter.totals['$type'] != null);
+ activeInfoTypes
+ .forEach((type) => table.declareColumn('$type', abbreviate: true));
table.declareColumn('LinesOfCode', abbreviate: true);
table.addHeader();
@@ -207,7 +210,8 @@ String summaryToString(GlobalSummary summary) {
for (var package in counter.errorCount.keys) {
appendCount(package);
appendCount(counter.errorCount[package]['AnalyzerError']);
- infoTypes.forEach((e) => appendCount(counter.errorCount[package]['$e']));
+ activeInfoTypes
+ .forEach((e) => appendCount(counter.errorCount[package]['$e']));
appendCount(counter.linesOfCode[package]);
}
@@ -216,7 +220,7 @@ String summaryToString(GlobalSummary summary) {
table.addHeader();
table.addEntry('total');
appendCount(counter.totals['AnalyzerError']);
- infoTypes.forEach((type) => appendCount(counter.totals['$type']));
+ activeInfoTypes.forEach((type) => appendCount(counter.totals['$type']));
appendCount(counter.totalLinesOfCode);
appendPercent(count, total) {
@@ -228,7 +232,8 @@ String summaryToString(GlobalSummary summary) {
var totalLOC = counter.totalLinesOfCode;
table.addEntry('%');
appendPercent(counter.totals['AnalyzerError'], totalLOC);
- infoTypes.forEach((type) => appendPercent(counter.totals['$type'], totalLOC));
+ activeInfoTypes
+ .forEach((type) => appendPercent(counter.totals['$type'], totalLOC));
appendCount(100);
return table.toString();
« no previous file with comments | « lib/src/info.dart ('k') | test/checker/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698