Branch Coverage

blib/lib/Data/Beacon.pm
Criterion Covered Total %
branch 20 240 8.3


line true false branch
28 0 0 unless @_
30 0 0 if (@_ == 1)
36 0 0 if @_ % 2
40 0 0 unless $key =~ /^\s*([a-zA-Z_-]+)\s*$/
44 0 0 if (defined $value) { }
49 0 0 if ($value eq '') { }
50 0 0 if $key eq 'FORMAT'
53 0 0 if ($key eq 'TARGET') { }
0 0 elsif ($key eq 'FEED') { }
0 0 elsif ($key eq 'PREFIX') { }
0 0 elsif ($key =~ /^(REVISIT|TIMESTAMP)$/) { }
0 0 elsif ($key eq 'FORMAT') { }
0 0 elsif ($key eq 'EXAMPLES') { }
56 0 0 unless $value =~ /{ID}}/
59 0 0 unless _is_uri($uri)
62 0 0 unless $value =~ m[^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/[^#|]*)?(\?[^#|]*)?$]i
66 0 0 unless _is_uri($value)
69 0 0 if ($value =~ /^[0-9]+$/) { }
76 0 0 unless $value = 'Time::Piece'->strptime($value, '%Y-%m-%dT%T')
82 0 0 unless $value =~ /^([A-Z]+-)?BEACON$/
90 0 0 if ($value eq '')
106 0 0 defined $count ? :
116 0 0 wantarray ? :
136 0 0 @lines ? :
144 0 0 if defined $$self{'from'}
147 0 0 unless defined $line
162 0 0 if (defined $line) { }
166 0 0 unless defined $line
171 0 0 if @link
180 0 0 if $$self{'link'}
186 0 0 if ($$self{'link'})
187 0 0 unless ($$self{'expanded'})
199 0 0 @_ > 0 ? :
200 0 0 defined $_ ? :
203 0 0 if $fields[0] eq '' or grep {$_ =~ /\||\n|\r/;} @fields
207 0 0 unless _is_uri($fields[0]) and _is_uri($fields[3])
215 0 0 unless defined $source
217 0 0 if $source eq ''
219 0 0 if defined $$self{'meta'}{'PREFIX'}
222 0 0 _is_uri($source) ? :
228 0 0 unless defined $line
235 0 0 if @parts < 1 or $parts[0] =~ /^\s*$/
242 0 0 if ($has_link)
243 0 0 wantarray ? :
253 5 15 defined $_ ? :
256 0 5 if ($fields[0] eq '') { }
5 0 elsif (grep {$_ =~ /\|/;} @fields) { }
0 0 elsif (grep {$_ =~ /[\n\r]/;} @fields) { }
268 0 0 if ($msg)
278 0 0 if (defined $$self{'expected_examples'})
281 0 0 if defined $prefix
283 0 0 if ($$self{'expected_examples'}{$source})
286 0 0 unless keys %{$$self{'expected_examples'};}
291 0 0 if ($$self{'link_handler'})
292 0 0 if ($$self{'link_handler'} eq 'print') { }
0 0 elsif ($$self{'link_handler'} eq 'expand') { }
299 0 0 if ($@)
316 0 0 if ref $_[0] and UNIVERSAL::isa($_[0], 'Data::Beacon')
317 0 0 unless @_
318 0 0 defined $_ ? :
320 0 0 if $link[0] eq ''
322 0 0 if ($link[3] eq '') { }
0 0 elsif (_is_uri($link[3])) { }
324 0 0 if ($link[2] eq '')
326 0 0 if $link[1] eq ''
330 0 0 if ($link[2] eq '')
332 0 0 if $link[1] eq ''
345 0 7 if (@_ % 2 and not blessed($_[0]) and ref $_[0] and ref $_[0] eq 'HASH') { }
350 0 7 @_ % 2 ? :
354 0 7 if exists $param{'from'}
357 3 4 if ($param{'errors'})
359 3 0 unless ref $handler
361 1 2 unless (ref $handler and ref $handler eq 'CODE')
362 0 1 defined $handler ? :
371 0 6 if ($param{'links'})
373 0 0 unless $handler =~ /^(print|expand)$/ or ref $handler and ref $handler eq 'CODE'
379 0 6 if (defined $param{'pre'}) { }
0 6 elsif (exists $param{'pre'}) { }
380 0 0 unless ref $param{'pre'} and ref $param{'pre'} eq 'HASH'
396 0 6 if $$self{'pre'}
407 6 0 unless defined $$self{'from'}
411 0 0 if ($type) { }
0 0 elsif ($$self{'from'} eq '-') { }
412 0 0 if ($type eq 'SCALAR') { }
0 0 elsif ($type ne 'CODE') { }
421 0 0 unless (open $$self{'fh'}, $$self{'from'})
428 0 0 if ($$self{'mtime'})
435 0 0 unless defined $line
440 0 0 if ($line eq '') { }
0 0 elsif ($line =~ /^#([^:=\s]+)(\s*[:=]?\s*|\s+)(.*)$/) { }
445 0 0 if ($@)
465 2 3 if $$self{'error_handler'}
489 0 0 if ($$self{'fh'}) { }
0 0 elsif (ref $$self{'from'} and ref $$self{'from'} eq 'CODE') { }
493 0 0 if ($@)
499 0 0 @{$$self{'inputlines'};} ? :
514 0 0 if ($target or $targetprefix) { }
515 0 0 if @parts
516 0 0 if @parts
518 0 0 if @parts
520 0 0 if $n > 1 and _is_uri($parts[$n - 2])
522 0 0 if @parts
523 0 0 if @parts
536 0 0 unless _is_uri($exp[0])
540 0 0 unless _is_uri($exp[3])
555 0 0 if ($$link[1] =~ /^[0-9]*$/) { }
563 0 0 if (defined $msg) { }
572 0 0 if (defined $msg and $msg ne '')
588 0 0 if defined $prefix
593 0 0 if (defined $target) { }
0 0 elsif (defined $targetprefix) { }
612 0 0 unless defined $value
615 0 0 if $value =~ m<[^a-z0-9\:/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]>i
618 0 0 if $value =~ /%[^0-9a-f]/i
619 0 0 if $value =~ /%[0-9a-f](:?[^0-9a-f]|$)/i
626 0 0 unless defined $scheme and length $scheme and defined $path
629 0 0 if (defined $authority and length $authority) { }
630 0 0 unless length $path == 0 or $path =~ m[^/]
633 0 0 if $path =~ m[^//]
637 0 0 unless lc($scheme) =~ /^[a-z][a-z0-9\+\-\.]*$/