Condition Coverage

blib/lib/MP3/Tag.pm
Criterion Covered Total %
condition 195 366 53.2


and 2 conditions

line l !l condition
2622 0 0 eval { do { my($a, $b); $self->_parse_rex_microinterpolate("=$code", $a, $b) } } and die "escape `%${code}' can't be parsed; did you forget to put `='?"

and 3 conditions

line !l l&&!r l&&r condition
451 0 50 111 defined $out and length $out
612 1012 53 1 $pack eq 'ID3v1' and not $MP3::Tag::ID3v1::ok_length{$what}
613 53 1011 1 $do_can and not $self->{$pack}->can($what)
614 1064 0 0 $check_only and $self->{$pack}->can(my $m = $what . '_have')
620 190 71 0 not length $out and $ignore_0length{$pack}
688 0 2 2 not $force2 and $mp3->{'ID3v1'}->fits_tag({$elt, $val})
2 0 2 not $force2 and $mp3->{'ID3v1'}->fits_tag({$elt, $val}) and not exists $mp3->{'ID3v2'}
698 0 0 0 $w and $h
734 0 0 0 $h && $self->_Data_to_MIME($h, 1)
1513 0 7 0 @_ <= 2 and not defined $_[1]
1526 0 0 0 not $do and $fname =~ s/^(\w{4})(?:\(([^()]*(?:\([^()]+\)[^()]*)*)\))/$1/
1530 169 0 0 $update and not $tr
1532 135 18 15 @_ == 2 and not defined $_[1]
1709 0 0 0 $self->have_id3v2_frame_by_descr($tag) and not $forceframe
2136 4 0 0 $set and $_ .= '__set'
2150 196 73 55 $upto and $upto ne ']'
269 55 0 $upto and $upto ne ']' and $upto ne '}'
2151 196 128 0 $upto and not defined $upto
324 0 0 $upto and not defined $upto and $skip
2155 17 834 0 $cnt-- and $upto ? $upto eq ']' ? $_[1] =~ s/^((?:[^%\\\]]|(?:\\\\)*\\\]|\\+[^\\\]]|\\\\)+)|$pat_rx//os : $_[1] =~ s/^((?:[^%\\\}]|(?:\\\\)*\\\}|\\+[^\\\}]|\\\\)+)|$pat_rx//os : $_[1] =~ s/^([^%]+)|$pat_rx//os
2162 101 63 73 $upto and $upto eq ']'
101 0 63 $upto and $upto eq '}'
2171 285 5 0 $skip and $what ne '{'
2173 54 235 1 $what eq '{' and $_[1] =~ s/^([dD])(\d+)}//
54 235 0 $what eq '{' and $_[1] =~ s/^U(\d+)}//
54 175 60 $what eq '{' and $_[1] =~ s/^($longer_f|[mMS]L|SML)}//o
54 12 163 $what eq '{' and $_[1] =~ s/^(!)?(([talgcynfFeEABDNvLrqQSmsCpouMHwh]|ID3v[12]|ID3v2-modified|$longer_f|U\d+)(:|\|\|?)|$frame_bra)//o
54 12 0 $what eq '{' and $_[1] =~ s/^ID3v1}//
54 12 0 $what eq '{' and $_[1] =~ s/^(sh|nm)P\[//s
54 7 5 $what eq '{' and $_[1] =~ s/^I\((\w+)\)//s
54 6 1 $what eq '{' and $_[1] =~ s/^T\[([^\[\]]*)\]\}//s
2196 0 0 2 @handlers and @handlers == @_handlers
2202 126 2 0 @handlers and $have_bra
2216 96 0 2 $skip || $nonesuch and $_[1] =~ s/^\}//
2231 2 0 10 defined $_ && length $_
2239 37 0 28 $delim ne ':' && $delim
2240 37 28 0 $alt and $neg
2243 30 35 0 $simple and 2 >= length $simple || $simple =~ /^U/
2262 37 14 14 $alt and $alt ne '||'
2273 23 14 13 $alt and $have
37 6 7 $alt and $have and not $simple
2280 26 11 13 $have and $alt
2282 0 50 0 $str and ref $str
50 0 0 $str and ref $str and exists $str->{'_Data'}
2322 0 0 0 not $skip and $self->{'ID3v2'}
2346 0 0 0 $v2 and not exists $v2->{'frameIDs'}
2350 0 0 0 $v2 and not exists $v2->{'frameIDs'}
2365 269 3 0 defined $maxwidth and length $str > $maxwidth
2452 4 0 0 $e = $self->get_config('decode_encoding_files') and $e->[0]
2570 39 3 0 $min and $min ne '1'
2590 0 0 0 $fail and not my($o) = $self->process_handlers($id, $_[1], $_[2])
2597 46 0 0 $code eq 'y' and $self->get_config('year_is_timestamp')->[0]
2648 0 0 0 @handlers and @handlers == @_handlers
2652 23 0 0 @handlers and $have_bra
2668 0 24 21 !ref($_) && length $_ == 1
2701 35 0 0 wantarray and @a
2807 41 0 0 $e and $e->[0]
3083 36 15 0 not $c++ and $f =~ /^=>(\w)$/
3112 25 2 4 $what eq 's' || $what eq '{SL}' and grep $have{$_}, ('H', 'm', 'mL')
18 9 0 $what eq '{mL}' and $have{'H'}
3115 28 0 3 $what eq '%{ML}' and grep $have{$_}, ('H', 'm', 'mL', 's', 'S', 'SL')
3116 22 4 5 $what eq '%{SML}' and grep $have{$_}, ('H', 'm', 'mL')
3153 0 14 0 @wr == 1 and not $wr[0] =~ /\D/
3231 0 9 22 not $force2 and $mp3->{'ID3v1'}->fits_tag($data)
9 17 5 not $force2 and $mp3->{'ID3v1'}->fits_tag($data) and not exists $mp3->{'ID3v2'}
26 0 5 not $force2 and $mp3->{'ID3v1'}->fits_tag($data) and not exists $mp3->{'ID3v2'} and $do_length < 2
3251 26 0 0 $do_length and not $mp3->have_id3v2_frame('TLEN')
3295 0 36 37 length $genre and not $genre =~ /\D/
3320 2 0 82 exists $self->{'filename'} and defined $self->{'filename'}

or 2 conditions

line l !l condition
598 2 282 shift() || []
647 0 282 ($self->get_config("translate_$elt") || [])->[0] || sub { $_[1]; }
672 0 5 ($self->get_config("translate_$tr") || [])->[0] || sub { $_[1]; }
736 0 0 !$lazy && $self->_mime_type || 'application/octet-stream'
788 0 0 ($self->get_config("translate_$elt") || $self->get_config('translate_person') || [])->[0] || sub { $_[1]; }
1196 2 17 $self->{'config'} ||= {%MP3::Tag::Implemenation::config}
1255 2547 70 $self->{'config'} ||= {%MP3::Tag::Implemenation::config}
1322 0 0 $self->{'userdata'} ||= []
1330 0 0 $self->{'userdata'} ||= []
1518 0 169 $self->get_config('translate_person') || []
1531 0 169 $tr ||= sub { $_[1]; }
1614 0 0 $f_ids ||= [keys %{$from->get_frame_ids;}]
1649 0 0 $self->get_config('short_person') || []
1665 0 0 $self->get_config('translate_person') || []
1700 0 0 $v = $self->$1 or next
1712 0 0 $v = $self->$1 or next
2194 33 130 $lang_or_packages || ''
2243 14 30 $simple || ''
2248 0 0 do { {} unless $self->{'ID3v2'} }->{'modified'} || ''
2354 0 0 $v2 && $v2->{'modified'} || ''
2367 0 0 $1 or ''
2368 0 0 $1 or ''
2646 2 21 $4 || ''
2693 3 42 $h{$k} ||= []
3259 36 35 $how || 0
3260 36 35 $how || 0

or 3 conditions

line l !l&&r !l&&!r condition
221 87 0 0 -f $filename or -c $filename
247 0 0 88 $skip_weaken or not eval { do { require Scalar::Util; &Scalar::Util::weaken($self->[0]); 1 } }
294 85 0 0 $self->{'__proxy'}[0] or $ENV{'MP3TAG_TEST_WEAKEN'}
601 284 0 0 $self->{'__proxy'}[0] or $ENV{'MP3TAG_TEST_WEAKEN'}
637 0 282 0 $self->get_config($what) || $self->get_config('autoinfo')
667 20 0 0 $self->{'__proxy'}[0] or $ENV{'MP3TAG_TEST_WEAKEN'}
1320 0 0 0 $self->{'__proxy'}[0] or $ENV{'MP3TAG_TEST_WEAKEN'}
1349 6 0 0 @_ or exists $self->{'ID3v2'}
1503 0 0 1 @_ <= 3 or not defined $_[3]
1513 0 0 7 @_ <= 1 or @_ <= 2 and not defined $_[1]
1532 1 0 168 @_ > 2 or @_ == 2 and not defined $_[1]
1543 0 0 0 not defined $val or $val eq $nval
1696 0 0 0 $self->{'ID3v2'} or $forceframe
1710 0 0 0 $force{$tag} or $self->{'ID3v2'}
0 0 0 $force{$tag} or $self->{'ID3v2'} or $forceframe
2153 128 179 17 $upto || !defined($upto)
2196 35 126 2 $delim or $id =~ /^[A-Z]{3}[A-Z\d](\d\d)?\b/
161 0 2 $delim or $id =~ /^[A-Z]{3}[A-Z\d](\d\d)?\b/ or @handlers and @handlers == @_handlers
2211 2 0 96 @handlers or $self->{'ID3v2'}
94 0 2 @handlers or $self->{'ID3v2'} or $neg
2216 1 1 96 $skip || $nonesuch
2243 21 0 14 2 >= length $simple || $simple =~ /^U/
2260 2 0 63 $skip || !$alt && ($neg ? $have : !$have)
2315 5 1 0 $self->{'ID3v2'} or $skip
2397 17 0 128 not $upto or $upto eq ']' ? $_[1] =~ s/^\]// : $_[1] =~ s/^\}//
2648 23 0 0 $id =~ /^[A-Z]{3}[A-Z\d](\d\d)?\b/ or @handlers and @handlers == @_handlers
2684 35 0 0 @{$pattern->[2];} or $pattern->[3]
3032 0 0 0 $self->{'mp3info'} or $self->{'filename'} =~ /\.mp[23]$/i
3095 0 15 6 $what eq 'm' or $what eq '{mL}'
3097 4 0 11 int $time / 3600 || !grep($have{$_}, ('m', 'mL', 's', 'S', 'SL', 'SML'))
3100 9 0 6 int $time / 60 || !grep($have{$_}, ('s', 'S', 'SL', 'SML'))
3112 0 6 25 $what eq 's' || $what eq '{SL}'
4 0 27 $what eq 's' || $what eq '{SL}' and grep $have{$_}, ('H', 'm', 'mL') or $what eq '{mL}' and $have{'H'}
3280 12 0 2 $genre_num eq '255' or $genre_num eq ''
3287 18 9 61 $prefer_num or $genre =~ /\D/