Branch Coverage

blib/lib/WWW/Shorten/Yourls.pm
Criterion Covered Total %
branch 23 104 22.1


line true false branch
25 0 54 unless grep {$attr eq $_;} @{_attrs();}
26 30 24 unless @_
29 6 18 unless (defined $val)
41 54 2 if $attrs
52 0 0 unless $url and &blessed($url) and $url->isa('URI')
55 0 0 unless $res
56 0 0 unless ($res->is_success)
62 0 0 unless ($content_type and $content_type =~ m[application/json])
66 0 0 unless $json
73 0 0 if (@_ == 1 and ref $_[0]) { }
0 0 elsif (@_ == 1 and not ref $_[0]) { }
0 0 elsif (@_ % 2 == 0) { }
75 0 0 if $@
95 0 2 if $config
98 0 2 $^O eq 'MSWin32' ? :
99 0 2 if $ENV{'YOURLS_TEST_CONFIG'}
102 0 2 if ($path and $path->is_file)
108 0 0 if $line =~ /^\s*[;#]/
110 0 0 unless $line and $line =~ /=/
115 0 0 unless $key and $val
116 0 0 if $key eq 'user'
117 0 0 if $key eq 'base'
118 0 0 unless grep {$key eq $_;} @{$attrs;}
129 0 60 unless defined $input and not ref $input and length $input
138 0 2 if (@_ == 1 and ref $_[0]) { }
2 0 elsif (@_ % 2 == 0) { }
140 0 0 if $@
157 0 0 if $lc_key eq 'user'
158 0 0 if $lc_key eq 'base'
159 0 0 unless grep {$lc_key eq $_;} @{$attrs;}
162 0 2 $href->{'server'} ? :
169 0 0 unless my $server = $self->server
173 0 0 unless $short_url
181 0 0 if (my $sig = $self->signature) { }
187 0 0 unless ($user and $pass)
199 0 0 unless my $server = $self->server
203 0 0 unless $short_url
211 0 0 if (my $sig = $self->signature) { }
217 0 0 unless ($user and $pass)
229 0 0 if ($_[0] and &blessed($_[0]) and $_[0]->isa('WWW::Shorten::Yourls'))
232 0 0 unless my $url = shift()
235 0 0 unless ref $res eq 'HASH' and $res->{'longurl'}
241 0 0 if ($_[0] and &blessed($_[0]) and $_[0]->isa('WWW::Shorten::Yourls'))
244 0 0 unless my $url = shift()
254 14 16 unless @_
256 4 12 if (not defined $val or $val eq '') { }
4 8 elsif (&blessed($val) and $val->isa('URI')) { }
6 2 elsif ($val and not ref $val) { }
274 0 0 unless my $server = $self->server
278 0 0 unless $long_url
286 0 0 if (my $sig = $self->signature) { }
292 0 0 unless ($user and $pass)