Branch Coverage

blib/lib/File/AptFetch.pm
Criterion Covered Total %
branch 110 132 83.3


line true false branch
317 9 779 unless $self->{'method'} = shift @_
324 495 246 unless '' eq ($rc = $self->_cache_configuration)
325 1 245 unless 'File::AptFetch::ConfigData'->config('lib_method')
330 0 245 unless defined($self->{'pid'} = fork)
332 35 210 unless ($self->{'pid'})
335 0 35 unless open STDOUT, '>&=', $self->{'me'}->fileno
337 0 35 unless open STDIN, '<&=', $self->{'it'}->fileno
340 0 0 unless exec sprintf('%s/%s', 'File::AptFetch::ConfigData'->config('lib_method'), $self->{'method'})
353 0 208 if $self->{'ALRM_error'}
355 43 165 if exists $self->{'CHLD_error'}
356 0 165 unless @{$self->{'log'};}
365 39 126 if ('' ne ($rc = $self->_parse_status_code)) { }
0 126 elsif ($self->{'Status'} != 100) { }
97 29 elsif ('' ne ($rc = $self->_parse_message)) { }
405 157 549 if $self->{'pid'}
406 210 496 if $self->{'me'}
407 210 496 if $self->{'it'}
408 157 549 if $self->{'pid'}
463 7 156 unless ref $code eq 'CODE' or not defined $code
465 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') { }
553 0 25 ref $source ? :
554 0 25 unless $uri
563 0 25 unless $log
623 6 20 if $self->{'ALRM_error'}
625 10 10 if exists $self->{'CHLD_error'}
626 0 10 unless @{$self->{'log'};}
630 4 6 if ref $_gain_callback eq 'CODE' and not $rv
661 39 136 unless $self->{'log'}[0] =~ /^(\d{3})\s+(.+)/
732 39 193 if ($self->{'log'}[0] eq '')
736 97 96 unless my($header, $field) = $self->{'log'}[0] =~ /^([0-9a-z-]+):(?>\s+)(.+)/i
739 0 96 if exists $cache{$header}
744 0 39 unless $self->{'diag'}[-1] eq ''
747 29 10 $self->{'Status'} == 100 ? :
864 201 578 if @apt_config
867 0 578 unless defined($self->{'pid'} = fork)
869 38 540 unless ($self->{'pid'})
872 0 38 unless open STDIN, '<', '/dev/null'
873 0 38 unless open STDOUT, '>&=', $self->{'me'}->fileno
875 0 0 unless exec @{'File::AptFetch::ConfigData'->config('config_source');}
884 0 540 unless $self->{'me'}->close
888 29 511 if $self->{'pid'}
890 29 511 if $self->{'ALRM_error'}
893 31 480 if $self->{'CHLD_error'}
894 30 450 unless @{$self->{'log'};}
899 187 148 if not $name =~ m[^[\w/:.+-]+$] or $name =~ /(?
903 4 144 if ($value = $1) eq ''
908 5 40 unless ('File::AptFetch::ConfigData'->config('lib_method'))
910 13 4 unless $rec =~ /^Dir::Bin::methods=(.+)$/
1071 2 1375 if $_select_callback
1072 564 0 do { $self->{'me'}->eof } ? :
635 564 do { @line = $self->{'me'}->getlines } ? :
1199 176 select($vec, undef, undef, $self->{'tick'}) ? :
1076 40 131 if ($rc) { }
35 96 elsif ($timeout < 0) { }
1084 175 460 if grep(($_ eq ''), @line)
1145 2 128 unless defined $st->{'filename'}
1147 25 103 unless $st->{'tick'}
1148 27 101 unless defined $st->{'flag'}
1149 42 86 unless defined $st->{'tmp'}
1150 9 109 do { not -f $st->{'tmp'} } ? :
118 10 defined $st->{'tmp'} ? :
1161 109 0 if 1 > $st->{'factor'}
1162 26 83 if $st->{'size'} - $st->{'back'}