Branch Coverage

blib/lib/File/AptFetch.pm
Criterion Covered Total %
branch 111 134 82.8


line true false branch
317 9 779 unless $self->{'method'} = shift @_
325 495 246 unless "" eq ($rc = $self->_cache_configuration)
326 1 245 unless "File::AptFetch::ConfigData"->config("lib_method")
331 0 245 unless defined($self->{'pid'} = fork)
333 35 210 unless ($self->{'pid'})
336 0 35 unless open STDOUT, ">&=", $self->{'me'}->fileno
338 0 35 unless open STDIN, "<&=", $self->{'it'}->fileno
341 0 0 unless exec sprintf("%s/%s", "File::AptFetch::ConfigData"->config("lib_method"), $self->{'method'})
354 0 208 if $self->{'ALRM_error'}
356 43 165 if exists $self->{'CHLD_error'}
357 0 165 unless @{$self->{'log'};}
366 52 113 if ('' ne ($rc = $self->_parse_status_code)) { }
0 113 elsif ($self->{'Status'} != 100) { }
84 29 elsif ('' ne ($rc = $self->_parse_message)) { }
406 157 549 if $self->{'pid'}
407 210 496 if $self->{'me'}
408 210 496 if $self->{'it'}
409 157 549 if $self->{'pid'}
464 7 156 unless ref $code eq "CODE" or not defined $code
466 116 40 if ($tag eq 'read' and $code) { }
5 35 elsif ($tag eq 'read') { }
16 19 elsif ($tag eq 'gain') { }
12 7 elsif ($tag eq 'select') { }
554 0 25 ref $source ? :
555 0 25 unless $uri
564 0 25 unless $log
624 6 20 if $self->{'ALRM_error'}
626 10 10 if exists $self->{'CHLD_error'}
627 0 10 unless @{$self->{'log'};}
631 4 6 if ref $_gain_callback eq "CODE" and not $rv
662 52 123 unless $self->{'log'}[0] =~ /^(\d{3})\s+(.+)/
733 39 180 if ($self->{'log'}[0] eq "")
737 84 96 unless my($header, $field) = $self->{'log'}[0] =~ /^([0-9a-z-]+):(?>\s+)(.+)/i
740 0 96 if exists $cache{$header}
745 0 39 unless $self->{'diag'}[-1] eq ""
748 29 10 $self->{'Status'} == 100 ? :
865 201 578 if @apt_config
868 0 578 unless defined($self->{'pid'} = fork)
870 38 540 unless ($self->{'pid'})
873 0 38 unless open STDIN, "<", "/dev/null"
874 0 38 unless open STDOUT, ">&=", $self->{'me'}->fileno
876 0 0 unless exec @{"File::AptFetch::ConfigData"->config("config_source");}
885 0 540 unless $self->{'me'}->close
889 29 511 if $self->{'pid'}
891 29 511 if $self->{'ALRM_error'}
894 31 480 if $self->{'CHLD_error'}
895 30 450 unless @{$self->{'log'};}
900 143 148 if not $name =~ m[^[\w/:.+-]+$] or $name =~ /(?
904 4 144 if ($value = $1) eq ""
909 5 40 unless ("File::AptFetch::ConfigData"->config("lib_method"))
911 13 4 unless $rec =~ /^Dir::Bin::methods=(.+)$/
1073 2 1388 if $_select_callback
1074 564 0 do { not $flag } ? :
648 564 do { $flag } ? :
0 1212 do { not defined(my $flag = $self->{'me'}->sysread(my $buffer, 4096)) } ? :
1212 176 select($vec, undef, undef, $self->{'tick'}) ? :
1078 40 131 if ($rc) { }
35 96 elsif ($timeout < 0) { }
1094 175 473 if grep(($_ eq ""), @prelog)
1155 2 128 unless defined $st->{'filename'}
1157 25 103 unless $st->{'tick'}
1158 27 101 unless defined $st->{'flag'}
1159 42 86 unless defined $st->{'tmp'}
1160 9 109 do { not -f $st->{'tmp'} } ? :
118 10 defined $st->{'tmp'} ? :
1171 109 0 if 1 > $st->{'factor'}
1172 26 83 if $st->{'size'} - $st->{'back'}