dart-lang / pana

Package ANAlysis for Dart
https://pub.dev/packages/pana
BSD 3-Clause "New" or "Revised" License
205 stars 44 forks source link

Pubspec parsing error returns scores of 100 #564

Closed axel-op closed 3 years ago

axel-op commented 5 years ago

On this line: https://github.com/dart-lang/pana/blob/master/lib/src/package_analyzer.dart#L127, when a pubspec file cannot be found or parsed, health and maintenance scores are both returned with a value of 100.

This is because a Summary widget is returned with null maintenance and health fields, so the _calculateScore function (https://github.com/dart-lang/pana/blob/master/bin/pana.dart#L213) automatically set these two scores to 100.

axel-op commented 4 years ago

Another thing is that the penality of 100.0 given on this line is never applied because this suggestion is added to the "general" suggestion list and not to the maintenance suggestion list. And no score is calculated based on this "general" suggestion list.

isoos commented 4 years ago

Ah, good points here. Curious: do you know about a package on pub that has this?

axel-op commented 4 years ago

@isoos Not at all, I'm sorry.