Branch Coverage

blib/lib/Google/Search.pm
Criterion Covered Total %
branch 29 98 29.5


line true false branch
41 0 8 if (ref $_ eq 'HASH') { }
2 6 elsif (ref $_ eq 'ARRAY') { }
6 0 elsif (not ref $_) { }
54 0 0 blessed $self ? :
58 0 0 unless defined $_
59 0 0 if (not ref $_) { }
0 0 elsif (ref $_ eq 'ARRAY') { }
0 0 elsif (ref $_ eq 'HASH') { }
65 0 0 unless defined $term
67 0 0 if @query % 2
70 0 0 unless exists $query{'q'}
83 0 0 if defined $user_agent
86 0 0 unless $response->is_success
88 0 0 unless $content =~ s/^.*?\(\[(.*)\]\)$/[$1]/g
90 0 0 unless ref $data eq 'ARRAY' and $$data[1]
98 0 6 unless $service
100 0 6 unless my $uri = $Google::Search::Service2URI{$service}
108 0 13 if (1 == @_ and ref $_[0] eq 'HASH') { }
1 12 elsif (3 == @_ and $_[0] eq 'service' and not ref $_[2] and defined $_[2]) { }
11 1 elsif (0 == @_ % 2) { }
1 0 elsif (@_ > 3 and $_[0] eq 'service') { }
128 10 3 if defined $query and not defined $$given{'query'}
131 1 12 if defined $version and not defined $$given{'version'}
134 0 13 if defined $referrer and not defined $$given{'referer'}
140 31 1 if $key =~ /^(?:agent|service|uri|query|version|hl|referer| key|start|rsz|rsz2number|current|error)$/x
146 1 12 if @query
176 0 6 unless $uri
203 0 0 if $rsz eq 'small'
204 0 0 if $rsz eq 'large'
219 0 0 unless my $http_response = $self->agent->request($http_request)
232 2 4 if $referer
233 0 6 if $key
239 1 5 if $self->has_hl
244 0 6 if ($ENV{'GS_TRACE'})
250 0 6 if ($ENV{'GS_TRACE'} and $request)
266 0 0 if $page->error
280 0 0 unless $$self{'current'}
291 0 0 if $self->_result->[$number]
297 0 0 if ($content) { }
305 0 0 unless $result
315 0 0 if ($self->error)
316 0 0 unless $self->error->message eq 'out of range start'
320 0 0 wantarray ? :
331 0 0 if &$matcher($result)
334 0 0 if ($self->error)
335 0 0 unless $self->error->message eq 'out of range start'
347 0 0 if &$matcher($result)
350 0 0 if ($self->error)
351 0 0 unless $self->error->message eq 'out of range start'