Branch Coverage

blib/lib/Net/DRI/Util.pm
Criterion Covered Total %
branch 139 236 58.9


line true false branch
103 25 577 unless defined $_ and ref $_ || length $_
113 3 0 unless exists $rmaster->{$k}
116 18 0 unless exists $rmaster->{$k}{$kk}
127 0 0 unless defined $in
129 0 0 unless $ref
131 0 0 if "$in" =~ /^(\S+)=([A-Z]+)\(0x/
133 0 0 if ($ref eq 'SCALAR') { }
0 0 elsif ($ref eq 'HASH') { }
0 0 elsif ($ref eq 'ARRAY') { }
139 0 0 defined $in->{$_} && ref $in->{$_} ? :
140 0 0 if defined $cname
144 0 0 defined $_ && ref $_ ? :
157 0 0 unless exists $seen{$rs[$i]}
168 3 2 $in =~ /^\d+$/ ? :
181 2 5 unless defined $input
182 2 3 ref $ra ? :
184 3 3 if $a =~ /^$input$/
186 1 1 if $default
193 1 16 unless $what and is_class($what, $isa)
200 22 13 eval { do { $obj->isa($class) } } ? :
206 0 0 defined $cs && is_class($cs, 'Net::DRI::Data::ContactSet') && !$cs->is_empty ? :
212 9 0 unless defined $class
213 0 9 defined $c && is_class($c, $class) ? :
219 1 2 unless defined $emptyok
220 0 3 defined $h && is_class($h, 'Net::DRI::Data::Hosts') && ($emptyok || !$h->is_empty) ? :
226 0 0 defined $h && is_class($h, 'Net::DRI::Data::Hosts') ? :
232 3 0 defined $c && is_class($c, 'Net::DRI::Data::Changes') && !$c->is_empty ? :
238 0 0 defined $s && is_class($s, 'Net::DRI::Data::StatusList') && !$s->is_empty ? :
244 0 211 unless defined $key and $key
245 123 88 unless defined $rh and ref $rh eq 'HASH' and exists $rh->{$key} and defined $rh->{$key}
270 0 0 has_key($rh, 'auth') && ref $rh->{'auth'} eq 'HASH' ? :
276 0 0 has_key($rh, 'status') && isa_statuslist($rh->{'status'}) ? :
305 5 2 unless defined $rd
306 0 2 unless ref $rd eq 'HASH'
315 1 234 unless defined $name
316 226 8 unless defined $unicode
321 4 287 unless defined $d and $d ne ''
322 1 286 unless length $d <= 63
323 2 284 if $d =~ /^-/ or $d =~ /-$/
324 194 90 if not $unicode and $d =~ /[^A-Za-z0-9\-]/
333 1 38 unless defined $ip
335 4 34 unless @ip == 4
338 1 132 unless $s >= 0 and $s <= 255
341 1 32 unless defined $checkpublic and $checkpublic
344 1 31 if $ip[0] == 0
345 1 30 if $ip[0] == 10
346 1 29 if $ip[0] == 127
347 1 28 if $ip[0] == 169 and $ip[1] == 254
348 1 1 if $ip[0] == 172 and $ip[1] >= 16 and $ip[1] <= 31
349 1 5 if $ip[0] == 192 and $ip[1] == 0 and $ip[2] == 2
350 1 25 if $ip[0] == 192 and $ip[1] == 168
351 1 24 if $ip[0] >= 224 and $ip[0] < 240
352 0 24 if $ip[0] >= 240
360 0 12 unless defined $ip
363 0 12 unless @ip > 0 and @ip <= 8
364 0 12 if $ip =~ /^:[^:]/ or $ip =~ /[^:]:$/
365 0 12 if $ip =~ s/:(?=:)//g > 1
368 11 1 if grep {not /^[a-f\d]{0,4}$/i;} @ip
370 0 1 unless defined $checkpublic and $checkpublic
380 0 1 if $bip =~ /^0{127}/
381 0 1 if $bip =~ /^1{7}/
384 0 1 if $bip =~ /^000/
385 1 0 if $bip =~ /^001/
414 4 6 if $r == 0
415 1 5 if $what =~ /[\r\n\t]/
422 1 9 unless defined $what
423 0 9 if defined &Scalar::Util::reftype($what)
424 0 9 unless $what =~ /^[\x{0009}\x{000A}\x{000D}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]*$/
426 1 8 if defined $min and $l < $min
427 2 6 if defined $max and $l > $max
435 1 12 unless defined $what
436 0 12 if defined &Scalar::Util::reftype($what)
437 1 11 if $what =~ /[\r\n\t]/
438 1 10 if $what =~ /^\s/
439 1 9 if $what =~ /\s$/
440 1 8 if $what =~ /\s\s/
443 1 7 if defined $min and $l < $min
444 2 5 if defined $max and $l > $max
451 0 0 unless defined $what and $what
452 0 0 if defined &Scalar::Util::reftype($what)
456 1 4 defined $in && $in =~ /^\d+$/ && $in < 65536 ? :
457 1 4 defined $in && $in =~ /^\d+$/ && $in < 256 ? :
458 2 2 defined $in && $in =~ /^[0-9A-F]+$/i ? :
462 2 11 unless defined $in and $in =~ /^-?\d+$/
463 5 6 defined $min ? :
3 8 if $in < (defined $min ? $min : -2147483648)
464 4 4 defined $max ? :
3 5 if $in > (defined $max ? $max : 2147483647)
474 4 27 unless $in =~ /^(?:(?:$b64 ?$b64 ?$b64 ?$b64 ?)*(?:(?:$b64 ?$b64 ?$b64 ?$b64)|(?:$b64 ?$b64 ?$b16 ?=)|(?:$b64 ?$b04 ?= ?=)))?$/
475 3 24 if defined $min and length $in < $min
476 1 23 if defined $max and length $in > $max
484 0 3 unless defined $in
485 2 1 if $in =~ /^[a-zA-Z]{1,8}(?:-[a-zA-Z0-9]{1,8})*$/
492 0 6 unless defined $in
493 4 2 if $in =~ /^(?:1|0|true|false)$/
516 0 0 ref $rd->[0] ? :
522 0 0 if (ref $e eq 'HASH') { }
531 0 0 keys %attr ? :
532 0 0 if (not @c or @c == 1 and not ref $c[0] and $c[0] eq '') { }
538 0 0 @c == 1 && !ref($c[0]) ? :
558 0 0 if $m =~ /^\s*$/
559 0 0 if $m =~ m[^$]
564 0 0 if $m =~ m[^<[^>?]+[^/](?:\s+\S+=['"][^'"]+['"])*>$]
565 0 0 if $m =~ m[^$]
574 0 0 if ($in ne $out)
584 0 0 unless defined $name_filter
592 0 0 if @nodes
594 0 0 unless $r->size
595 0 0 $r->size == 1 ? :
602 0 0 unless $list->size == 1
604 0 0 defined $n ? :
617 0 0 ref $data ? :
631 12 3 if $type eq 'domain' or $type eq 'nsgroup'
632 3 12 if $type eq 'host' and $key =~ /\./
641 0 0 $date->microsecond ? :
660 0 0 if (@o > 1)
672 0 0 unless $o[$i][0] >= $r
692 67 204 if not defined $ok && $ok or $@