Skip to content

Commit

Permalink
Emit suggestion and penalty only when coverage is below 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Oct 23, 2018
1 parent 7704bce commit 761fa90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/lib/dartdoc/dartdoc_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const _pubDataFileName = 'pub-data.json';
const _sdkTimeout = const Duration(minutes: 20);
final Duration _twoYears = const Duration(days: 2 * 365);

// We'll emit a suggestion and apply score penalty only if the coverage is below
// this value.
const _coverageEmitThreshold = 0.1;

final _pkgPubDartdocDir =
Platform.script.resolve('../../pkg/pub_dartdoc').toFilePath();

Expand Down Expand Up @@ -218,7 +222,7 @@ class DartdocJobProcessor extends JobProcessor {
coverageScore = documented / total;
}

if (coverageScore < 1.0) {
if (coverageScore < _coverageEmitThreshold) {
final level = coverageScore < 0.2
? SuggestionLevel.warning
: SuggestionLevel.hint;
Expand Down

0 comments on commit 761fa90

Please sign in to comment.