OLD | NEW |
---|---|
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analysis_server.src.status.get_handler; | 5 library analysis_server.src.status.get_handler; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
639 } | 639 } |
640 Set<AnalysisTarget> countedTargets = new HashSet<AnalysisTarget>(); | 640 Set<AnalysisTarget> countedTargets = new HashSet<AnalysisTarget>(); |
641 Map<String, int> sourceTypeCounts = new HashMap<String, int>(); | 641 Map<String, int> sourceTypeCounts = new HashMap<String, int>(); |
642 Map<String, int> typeCounts = new HashMap<String, int>(); | 642 Map<String, int> typeCounts = new HashMap<String, int>(); |
643 int explicitSourceCount = 0; | 643 int explicitSourceCount = 0; |
644 int explicitLineInfoCount = 0; | 644 int explicitLineInfoCount = 0; |
645 int explicitLineCount = 0; | 645 int explicitLineCount = 0; |
646 int implicitSourceCount = 0; | 646 int implicitSourceCount = 0; |
647 int implicitLineInfoCount = 0; | 647 int implicitLineInfoCount = 0; |
648 int implicitLineCount = 0; | 648 int implicitLineCount = 0; |
649 analysisServer.folderMap | 649 for (InternalAnalysisContext context |
650 .forEach((Folder folder, InternalAnalysisContext context) { | 650 in analysisServer.analysisContexts) { |
651 Set<Source> explicitSources = new HashSet<Source>(); | 651 Set<Source> explicitSources = new HashSet<Source>(); |
652 Set<Source> implicitSources = new HashSet<Source>(); | 652 Set<Source> implicitSources = new HashSet<Source>(); |
653 AnalysisCache cache = context.analysisCache; | 653 AnalysisCache cache = context.analysisCache; |
654 MapIterator<AnalysisTarget, CacheEntry> iterator = cache.iterator(); | 654 MapIterator<AnalysisTarget, CacheEntry> iterator = cache.iterator(); |
655 while (iterator.moveNext()) { | 655 while (iterator.moveNext()) { |
656 AnalysisTarget target = iterator.key; | 656 AnalysisTarget target = iterator.key; |
657 if (countedTargets.add(target)) { | 657 if (countedTargets.add(target)) { |
658 if (target is Source) { | 658 if (target is Source) { |
659 String name = target.fullName; | 659 String name = target.fullName; |
660 String sourceName; | 660 String sourceName; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
701 return previousTotal + lineInfo.lineCount; | 701 return previousTotal + lineInfo.lineCount; |
702 } else { | 702 } else { |
703 return previousTotal; | 703 return previousTotal; |
704 } | 704 } |
705 }); | 705 }); |
706 } | 706 } |
707 explicitSourceCount += explicitSources.length; | 707 explicitSourceCount += explicitSources.length; |
708 explicitLineCount += lineCount(explicitSources, true); | 708 explicitLineCount += lineCount(explicitSources, true); |
709 implicitSourceCount += implicitSources.length; | 709 implicitSourceCount += implicitSources.length; |
710 implicitLineCount += lineCount(implicitSources, false); | 710 implicitLineCount += lineCount(implicitSources, false); |
711 }); | 711 } |
712 ; | |
scheglov
2016/02/29 19:03:37
Remove this line.
Brian Wilkerson
2016/02/29 20:45:11
Done
| |
712 List<String> sourceTypeNames = sourceTypeCounts.keys.toList(); | 713 List<String> sourceTypeNames = sourceTypeCounts.keys.toList(); |
713 sourceTypeNames.sort(); | 714 sourceTypeNames.sort(); |
714 List<String> typeNames = typeCounts.keys.toList(); | 715 List<String> typeNames = typeCounts.keys.toList(); |
715 typeNames.sort(); | 716 typeNames.sort(); |
716 | 717 |
717 buffer.write('<p><b>Target counts</b></p>'); | 718 buffer.write('<p><b>Target counts</b></p>'); |
718 buffer.write( | 719 buffer.write( |
719 '<table style="border-collapse: separate; border-spacing: 10px 5px ;">'); | 720 '<table style="border-collapse: separate; border-spacing: 10px 5px ;">'); |
720 _writeRow(buffer, ['Target', 'Count'], header: true); | 721 _writeRow(buffer, ['Target', 'Count'], header: true); |
721 for (String sourceTypeName in sourceTypeNames) { | 722 for (String sourceTypeName in sourceTypeNames) { |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1347 buffer.write(lint.runtimeType); | 1348 buffer.write(lint.runtimeType); |
1348 buffer.write('</p>'); | 1349 buffer.write('</p>'); |
1349 } | 1350 } |
1350 } | 1351 } |
1351 | 1352 |
1352 List<ErrorProcessor> errorProcessors = | 1353 List<ErrorProcessor> errorProcessors = |
1353 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); | 1354 context.getConfigurationData(CONFIGURED_ERROR_PROCESSORS); |
1354 int processorCount = errorProcessors?.length ?? 0; | 1355 int processorCount = errorProcessors?.length ?? 0; |
1355 buffer.write('<p><b>Error Processor count</b>: $processorCount</p>'); | 1356 buffer.write('<p><b>Error Processor count</b>: $processorCount</p>'); |
1356 }); | 1357 }); |
1357 | 1358 |
1358 SourceFactory sourceFactory = context.sourceFactory; | 1359 SourceFactory sourceFactory = context.sourceFactory; |
1359 if (sourceFactory is SourceFactoryImpl) { | 1360 if (sourceFactory is SourceFactoryImpl) { |
1360 buffer.write('<h3>Resolvers</h3>'); | 1361 buffer.write('<h3>Resolvers</h3>'); |
1361 for (UriResolver resolver in sourceFactory.resolvers) { | 1362 for (UriResolver resolver in sourceFactory.resolvers) { |
1362 buffer.write('<p>'); | 1363 buffer.write('<p>'); |
1363 buffer.write(resolver.runtimeType); | 1364 buffer.write(resolver.runtimeType); |
1364 buffer.write('</p>'); | 1365 buffer.write('</p>'); |
1365 } | 1366 } |
1366 } | 1367 } |
1367 | 1368 |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2483 */ | 2484 */ |
2484 static String makeLink( | 2485 static String makeLink( |
2485 String path, Map<String, String> params, String innerHtml, | 2486 String path, Map<String, String> params, String innerHtml, |
2486 [bool hasError = false]) { | 2487 [bool hasError = false]) { |
2487 Uri uri = new Uri(path: path, queryParameters: params); | 2488 Uri uri = new Uri(path: path, queryParameters: params); |
2488 String href = HTML_ESCAPE.convert(uri.toString()); | 2489 String href = HTML_ESCAPE.convert(uri.toString()); |
2489 String classAttribute = hasError ? ' class="error"' : ''; | 2490 String classAttribute = hasError ? ' class="error"' : ''; |
2490 return '<a href="$href"$classAttribute>$innerHtml</a>'; | 2491 return '<a href="$href"$classAttribute>$innerHtml</a>'; |
2491 } | 2492 } |
2492 } | 2493 } |
OLD | NEW |