Branch Coverage

lib/Net/LastFMAPI.pm
Criterion Covered Total %
branch 25 78 32.0


line true false branch
31 0 0 if ($key) { }
44 1 15 if (defined $v)
49 1 1 if keys %configs
208 55 2 if (ref $p eq 'HASH') { }
212 1 54 if $i > 49
221 2 0 unless $params{'format'} or $xml
222 1 2 if $params{'format'} and $params{'format'} eq 'xml'
224 0 3 if (not exists $$methods{$method}) { }
0 6 elsif (defined $params{'page'} and not $$methods{$method}{'page'}) { }
238 0 3 if ($cache)
239 0 0 unless (-d $cache)
245 0 0 if (-f $file)
254 1 2 if ($$methods{$method}{'post'}) { }
265 0 3 if $content eq qq[""\n]
270 0 1 unless ($res->is_success and $params{'format'} eq 'json' && !exists(&$decoded_json()->{'error'}) || $params{'format'} eq 'xml' && $content =~ //)
275 0 0 if ($res->is_success)
276 0 0 if ($res->decoded_content =~ /Invalid session key - Please re-authenticate/) { }
0 0 elsif ($$methods{$method}) { }
285 0 0 if (ref $content eq 'HASH') { }
302 0 3 if ($cache)
311 0 3 if wantarray
317 0 0 unless ($last_params{'format'})
323 0 0 unless (@main_keys == 1 and @data_keys == 2 and $data_keys[0] eq '@attr')
325 0 0 if defined $text and $text =~ /^\s+$/ and defined $total and $total == 0
330 0 0 if (ref $rows ne 'ARRAY')
332 0 0 if (ref $rows eq 'HASH') { }
0 0 elsif ($rows =~ /^\s+$/) { }
349 0 0 unless ($$params{'format'})
352 0 0 if (@rows == 0)
358 0 0 if $page++ >= $totalpages
366 0 0 unless (@rows)
376 0 3 unless (delete $$params{'auth'} or $m and $$m{'auth'})
383 0 3 unless (defined $session_key)
386 0 3 unless (defined $session_key)
389 0 0 if ($@)
400 0 0 unless my($token) = $res =~ m[(.+)]
407 0 0 unless ($username) = $sess =~ m[(.+)]
409 0 0 unless my($key) = $sess =~ m[(.+)]
426 2 1 unless $$methods{$$params{'method'}}{'signed'}