Branch Coverage

blib/lib/WebService/Freesound.pm
Criterion Covered Total %
branch 38 56 67.8


line true false branch
223 0 7 if (defined $client_id)
240 0 6 if (defined $client_secret)
256 0 14 if (defined $session_file)
272 0 26 if (defined $ua)
288 32 8 if (defined $error)
304 0 14 if (defined $access_token)
320 0 3 if (defined $refresh_token)
336 0 3 if (defined $expires_in)
417 3 1 if (-s $self->session_file) { }
421 0 3 unless open my $fh, '<', $self->session_file
433 3 0 if ($oauth_tokens) { }
447 2 1 if $timestamp + $oauth_tokens->{'expires_in'} < time
449 1 2 if (defined $args{'refresh_if_expired'} and $expired) { }
1 1 elsif ($expired) { }
463 0 1 unless ($self->_post_request($url, \%form))
492 2 2 if ($rc)
497 0 2 unless ($response->is_success)
526 2 5 unless $response->is_success
565 1 1 if ($filename)
567 0 1 unless open my $download_fh, '>', "$to/$filename"
589 0 0 if (defined $counter_file)
601 0 0 unless open my $counter_fh, '>', $counter_file
635 3 1 if ($response->is_success) { }
651 2 1 if (defined $details and defined $details->{'results'}[0]{'name'} and defined $details->{'results'}[0]{'type'}) { }
666 2 0 if $name =~ /\.$type\s*$/
705 3 1 if ($response->is_success) { }
719 2 1 if ($oauth_tokens) { }
723 0 2 unless open my $counter_fh, '>', $self->session_file