Branch Coverage

blib/lib/Net/DRI/Util.pm
Criterion Covered Total %
branch 137 228 60.0


line true false branch
102 25 514 unless defined $_ and ref $_ || length $_
112 3 0 unless exists $$rmaster{$k}
115 18 0 unless exists $$rmaster{$k}{$kk}
126 0 0 unless defined $in
128 0 0 unless $ref
130 0 0 if "$in" =~ /^(\S+)=([A-Z]+)\(0x/
132 0 0 if ($ref eq 'SCALAR') { }
0 0 elsif ($ref eq 'HASH') { }
0 0 elsif ($ref eq 'ARRAY') { }
138 0 0 defined $$in{$_} && ref $$in{$_} ? :
139 0 0 if defined $cname
143 0 0 defined $_ && ref $_ ? :
156 0 0 unless exists $seen{$rs[$i]}
167 3 2 $in =~ /^\d+$/ ? :
180 2 5 unless defined $input
181 2 3 ref $ra ? :
183 3 3 if $a =~ /^$input$/
185 1 1 if $default
192 1 16 unless $what and is_class($what, $isa)
199 22 13 eval { do { $obj->isa($class) } } ? :
205 0 0 defined $cs && is_class($cs, 'Net::DRI::Data::ContactSet') && !$cs->is_empty ? :
211 9 0 unless defined $class
212 0 9 defined $c && is_class($c, $class) ? :
218 1 2 unless defined $emptyok
219 0 3 defined $h && is_class($h, 'Net::DRI::Data::Hosts') && ($emptyok || !$h->is_empty) ? :
225 0 0 defined $h && is_class($h, 'Net::DRI::Data::Hosts') ? :
231 3 0 defined $c && is_class($c, 'Net::DRI::Data::Changes') && !$c->is_empty ? :
237 0 0 defined $s && is_class($s, 'Net::DRI::Data::StatusList') && !$s->is_empty ? :
243 0 184 unless defined $key and $key
244 109 75 unless defined $rh and ref $rh eq 'HASH' and exists $$rh{$key} and defined $$rh{$key}
269 0 0 has_key($rh, 'auth') && ref $$rh{'auth'} eq 'HASH' ? :
275 0 0 has_key($rh, 'status') && isa_statuslist($$rh{'status'}) ? :
304 5 2 unless defined $rd
305 0 2 unless ref $rd eq 'HASH'
314 1 234 unless defined $name
315 226 8 unless defined $unicode
320 4 287 unless defined $d and $d ne ''
321 1 286 unless length $d <= 63
322 2 284 if $d =~ /^-/ or $d =~ /-$/
323 194 90 if not $unicode and $d =~ /[^A-Za-z0-9\-]/
332 1 38 unless defined $ip
334 4 34 unless @ip == 4
337 1 132 unless $s >= 0 and $s <= 255
340 1 32 unless defined $checkpublic and $checkpublic
343 1 31 if $ip[0] == 0
344 1 30 if $ip[0] == 10
345 1 29 if $ip[0] == 127
346 1 28 if $ip[0] == 169 and $ip[1] == 254
347 1 1 if $ip[0] == 172 and $ip[1] >= 16 and $ip[1] <= 31
348 1 5 if $ip[0] == 192 and $ip[1] == 0 and $ip[2] == 2
349 1 25 if $ip[0] == 192 and $ip[1] == 168
350 1 24 if $ip[0] >= 224 and $ip[0] < 240
351 0 24 if $ip[0] >= 240
359 0 12 unless defined $ip
362 0 12 unless @ip > 0 and @ip <= 8
363 0 12 if $ip =~ /^:[^:]/ or $ip =~ /[^:]:$/
364 0 12 if $ip =~ s/:(?=:)//g > 1
367 11 1 if grep {not /^[a-f\d]{0,4}$/i;} @ip
369 0 1 unless defined $checkpublic and $checkpublic
379 0 1 if $bip =~ /^0{127}/
380 0 1 if $bip =~ /^1{7}/
383 0 1 if $bip =~ /^000/
384 1 0 if $bip =~ /^001/
413 4 6 if $r == 0
414 1 5 if $what =~ /[\r\n\t]/
421 1 9 unless defined $what
422 0 9 unless $what =~ /^[\x{0009}\x{000A}\x{000D}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/
424 1 8 if defined $min and $l < $min
425 2 6 if defined $max and $l > $max
433 1 12 unless defined $what
434 1 11 if $what =~ /[\r\n\t]/
435 1 10 if $what =~ /^\s/
436 1 9 if $what =~ /\s$/
437 1 8 if $what =~ /\s\s/
440 1 7 if defined $min and $l < $min
441 2 5 if defined $max and $l > $max
448 0 0 unless defined $what and $what
452 1 4 defined $in && $in =~ /^\d+$/ && $in < 65536 ? :
453 1 4 defined $in && $in =~ /^\d+$/ && $in < 256 ? :
454 2 2 defined $in && $in =~ /^[0-9A-F]+$/i ? :
458 2 11 unless defined $in and $in =~ /^-?\d+$/
459 5 6 defined $min ? :
3 8 if $in < (defined $min ? $min : -2147483648)
460 4 4 defined $max ? :
3 5 if $in > (defined $max ? $max : 2147483647)
470 4 27 unless $in =~ /^(?:(?:$b64 ?$b64 ?$b64 ?$b64 ?)*(?:(?:$b64 ?$b64 ?$b64 ?$b64)|(?:$b64 ?$b64 ?$b16 ?=)|(?:$b64 ?$b04 ?= ?=)))?$/
471 3 24 if defined $min and length $in < $min
472 1 23 if defined $max and length $in > $max
480 0 3 unless defined $in
481 2 1 if $in =~ /^[a-zA-Z]{1,8}(?:-[a-zA-Z0-9]{1,8})*$/
488 0 6 unless defined $in
489 4 2 if $in =~ /^(?:1|0|true|false)$/
512 0 0 ref $$rd[0] ? :
518 0 0 if (ref $e eq 'HASH') { }
527 0 0 keys %attr ? :
528 0 0 if (not @c or @c == 1 and not ref $c[0] and $c[0] eq '') { }
534 0 0 @c == 1 && !ref($c[0]) ? :
554 0 0 if $m =~ /^\s*$/
555 0 0 if $m =~ m[^$]
560 0 0 if $m =~ m[^<[^>?]+[^/](?:\s+\S+=['"][^'"]+['"])*>$]
561 0 0 if $m =~ m[^$]
570 0 0 if ($in ne $out)
586 0 0 if @nodes
588 0 0 unless $r->size
589 0 0 $r->size == 1 ? :
596 0 0 unless $list->size == 1
598 0 0 defined $n ? :
611 0 0 ref $data ? :
625 12 3 if $type eq 'domain' or $type eq 'nsgroup'
626 3 12 if $type eq 'host' and $key =~ /\./
635 0 0 $date->microsecond ? :
654 0 0 if (@o > 1)
666 0 0 unless $o[$i][0] >= $r
686 58 177 if not defined $ok && $ok or $@