Branch Coverage

script/moku-pona
Criterion Covered Total %
branch 81 160 50.6


line true false branch
131 0 9 if $ENV{'MOKU_PONA'}
133 0 9 if $ENV{'XDG_DATA_HOME'} and -d $ENV{'XDG_DATA_HOME'} . "/moku-pona"
134 0 9 if $ENV{'HOME'} and -d $ENV{'HOME'} . "/.local/moku-pona"
135 0 9 if $ENV{'HOME'} and -d $ENV{'HOME'} . "/.moku-pona"
136 0 9 if $ENV{'APPDATA'} and -d $ENV{'APPDATA'} . "/.moku-pona"
137 0 9 if $ENV{'LOGDIR'} and -d $ENV{'LOGDIR'} . "/.moku-pona"
139 0 9 if $ENV{'XDG_DATA_HOME'}
140 0 9 if $ENV{'HOME'} and -d $ENV{'HOME'} . "/.local"
141 9 0 if $ENV{'HOME'}
142 0 0 if $ENV{'APPDATA'}
143 0 0 if $ENV{'LOGDIR'}
183 32 17 if /^=> /u
185 13 4 if ($host and $port)
206 0 0 unless $scheme and $scheme eq "gemini"
207 0 0 unless $authority
215 0 0 if ($err)
224 0 0 unless $header
237 0 12 if ($err)
255 0 12 unless $scheme =~ /^gophers?$/u
256 12 0 if substr($path, 0, 1) eq "/"
257 12 0 $path ? :
258 12 0 $path ? :
272 0 0 if $query
274 0 0 $tls ? :
283 0 0 unless $header
304 8 22 unless -f $file
305 0 22 unless open my $fh, "<:encoding(UTF-8)", $file
314 3 17 unless -f $file
315 0 17 unless open my $fh, "<:encoding(UTF-8)", $file
324 1 23 unless -d $data_dir
325 0 24 unless open my $fh, ">:encoding(UTF-8)", $file
355 0 1 if (@args) { }
360 0 1 unless @$site
362 0 2 if @args and &none(sub { $line =~ /$_/u; } , @args)
392 0 8 if (grep /^=> $uri_re /u, @$site) { }
0 8 elsif (grep /^=> \S+ $name_re$/u, @$site) { }
425 2 2 if ($name eq $args[$j]) { }
434 2 2 unless $found
436 2 0 if ($count) { }
437 2 0 $count == 1 ? :
478 0 2 unless opendir my $dh, $data_dir
483 2 6 if $file eq $site_list
484 2 4 if $file eq $updated_list
485 2 2 if $caches{$file}
486 1 1 if ($confirm) { }
494 2 0 if (-f $updated_list)
495 0 2 unless open my $fh, "<:encoding(UTF-8)", $updated_list
504 2 2 if ($line =~ /^=> \S+ \d\d\d\d-\d\d-\d\d (.+)/u and not $sites{$1}) { }
511 1 1 if @deletes and not $confirm
514 1 1 if $confirm
516 1 1 if ($todo and not $confirm)
565 4 1 if (-f $updated_list)
566 0 4 unless open my $fh, "<:encoding(UTF-8)", $updated_list
593 0 12 unless @sites == 0 or grep {$_ eq $name;} @sites
594 12 0 unless $quiet
598 12 0 if ($uri =~ /^gopher/u) { }
0 0 elsif ($uri =~ /^gemini/u) { }
0 0 elsif ($uri =~ /^http/u) { }
609 6 0 unless "Mojo::IOLoop"->is_running
615 0 12 unless ($new)
622 2 10 if ($new =~ /^<(\?xml|rss)/u)
628 5 7 if ($new ne $old) { }
629 5 0 unless $quiet
633 7 0 unless $quiet
682 0 5 if ($@)
694 7 0 $first ? :
698 1 6 unless $links
736 0 1 unless -d $target
737 0 1 unless -f $site_list
738 0 1 unless -f $updated_list
743 0 1 unless open my $in, "<:encoding(UTF-8)", $updated_list
745 0 1 unless open my $out, ">:encoding(UTF-8)", "$target/updates.txt"
754 1 0 if (-f "$data_dir/$uri")
768 0 0 if ($command eq 'add') { }
0 0 elsif ($command eq 'remove') { }
0 0 elsif ($command eq 'list') { }
0 0 elsif ($command eq 'cleanup') { }
0 0 elsif ($command eq 'update') { }
0 0 elsif ($command eq 'convert') { }
0 0 elsif ($command eq 'publish') { }