Branch Coverage

blib/lib/Net/Inet.pm
Criterion Covered Total %
branch 69 218 31.6


line true false branch
346 0 0 unless defined wantarray
347 0 0 if @_ != 1 and not wantarray
355 0 5 unless defined wantarray
356 0 5 if @_ != 1 and not wantarray
364 0 0 unless defined wantarray
365 0 0 if @_ != 1 and not wantarray
373 0 0 unless defined wantarray
374 0 0 if @_ != 1 and not wantarray
384 0 1 if @_ == 2
406 53 10 if ref $this
408 0 10 if defined $newval
432 0 2 if ref $class
433 2 0 defined $self ? :
436 2 0 if ($self) { }
437 0 0 if $debug > 1 and ref $self ne $class || !("$self" =~ /HASH/)
441 1 1 if (%Keys) { }
450 1 1 if (%Sopts) { }
460 0 2 if ($class eq 'Net::Inet')
461 0 0 unless ($self->init(@Args))
467 2 0 if ($self) { }
485 0 0 if @args == 1 and ref $args[0] and ref $args[0] eq 'ARRAY'
486 0 0 if $which ne 'dest' and $which ne 'this'
487 0 0 if (@$aref) { }
489 0 0 if (@$aref == 3 and ref $$aref[2] and ref $$aref[2] eq 'HASH') { }
495 0 0 if defined $$aref[0]
496 0 0 if defined $$aref[1]
509 0 2 unless $self = $self->SUPER::init(@args)
510 0 0 if (@args > 1 or @args == 1 and !ref($args[0]) || ref $args[0] ne 'HASH')
511 0 0 unless $self->_hostport('dest', @args)
515 2 0 if ($self->getparams(['type', 'proto'], 1) == 4)
516 0 2 unless ($self->open)
520 0 2 if ($self->getparam('srcaddrlist'))
522 0 0 unless $self->bind
524 0 2 if ($self->getparam('dstaddrlist'))
526 0 0 unless $self->connect or $self->isconnecting and not $self->blocking
538 0 0 if @args and not $self->_hostport('dest', @args)
547 0 1 if @_ != 3 or ref ${*$self;}{'Keys'}{$key} ne 'CODE'
549 0 1 unless (defined $newval)
551 0 0 if ($key eq 'thishost') { }
0 0 elsif ($key eq 'desthost') { }
559 0 0 if @delkeys and $self->isconnected
560 0 0 if @delkeys
568 0 1 if $newval =~ /^(.+):([-\w]+(?:\(\d+\))?)$/
570 1 0 if ($newval =~ /^(\[?)([a-fx.\d]+)(\]?)$/is)
571 0 1 if length $1 != length $3
575 0 1 if (defined $addr and substr($newval, 0, 1) eq '[') { }
585 0 1 if (not @hinfo and defined $addr) { }
590 0 1 unless @hinfo > 4
591 0 1 if $self->getparam('AF', 2, 1) != $hinfo[2]
596 0 1 if (not $addr =~ /.\../ and $hinfo[1])
598 0 0 if ($hname =~ /.\../)
608 0 1 unless defined $cport or defined $port or $pkey eq 'thisport'
612 0 1 if (defined $cport)
613 0 0 if $newval = &_setport($self, $pkey, $cport)
616 0 1 unless defined $port
621 0 1 $key eq 'desthost' ? :
627 0 1 if ${*$self;}{'Parms'}{'debug'}
3560 0 0 unless (%$defports)
3574 0 1 if @_ != 3 or not exists ${*$self;}{'Keys'}{$key}
3581 0 1 unless (defined $newval)
3583 0 0 unless $self->isconnected
3585 0 0 if ($pkey eq 'thisport') { }
0 0 elsif ($pkey eq 'destport') { }
3591 0 0 if @delkeys and $self->isconnected
3592 0 0 if @delkeys
3598 0 1 if (not defined $pname || $proto and defined($type = $self->getparam('type')))
3601 0 0 if ($type == 1) { }
0 0 elsif ($type == 2) { }
3608 0 1 if (defined $proto and not defined $pname)
3610 0 0 unless (defined $pname)
3611 0 0 if ($proto == 17) { }
0 0 elsif ($proto == 6) { }
0 0 elsif ($proto == 1) { }
3626 0 1 if defined $port and $port =~ /\D/
3628 0 1 if $newval =~ /^(.+)\((\d+)\)$/
3630 0 1 if ($skey eq $key or $newval =~ /\D/)
3633 1 0 unless ($newval =~ /\D/ or @serv)
3635 1 0 if $pname
3637 0 1 if (@serv) { }
0 1 elsif (not $defport and $newval =~ /\D/) { }
0 1 elsif ($defport and $newval) { }
0 1 elsif ($key eq $skey or $newval =~ /\D/) { }
3639 0 0 unless $key eq $pkey and not $newval =~ /\D/
3642 0 0 if ($pname eq 'udp') { }
0 0 elsif ($pname eq 'tcp') { }
3648 0 0 unless $defport
3659 0 1 $key eq $skey ? :
3660 0 1 if $svc
3662 0 1 if $svc and $self->debug
3664 0 1 if defined $port and $self->debug
3672 0 1 unless defined($host = ${*$self;}{'Parms'}{$hkey}) or $hkey eq 'thishost'
3673 1 0 unless defined $host
3682 0 6 unless (defined $newval)
3688 2 4 if ($key ne 'proto' or $newval =~ /\D/)
3690 2 0 if (@pval)
3695 4 0 unless (defined $proto or $newval =~ /\D/)
3699 0 6 unless defined $proto
3701 0 6 unless (defined $pname)
3702 0 0 if ($proto == 17) { }
0 0 elsif ($proto == 6) { }
0 0 elsif ($proto == 1) { }
3715 4 2 $key eq 'proto' ? :
3727 2 2 !@hinfo ? :
3739 0 2 if (defined $rem and length $rem)
3744 2 0 if (defined $lcl and length $lcl)
3749 0 0 defined $lcl || defined $rem ? :
0 2 wantarray ? :
3758 0 0 if ($numeric) { }
4481 0 1 if @args and not $self->_hostport('this', @args)