Branch Coverage

blib/lib/Net/DRI/Shell.pm
Criterion Covered Total %
branch 0 454 0.0


line true false branch
496 0 0 if (exists $$ctx{'term_features'}{'ornaments'})
505 0 0 if (exists $$ctx{'term_features'}{'readHistory'} and defined $HISTORY)
511 0 0 if @args and $args[0] eq 'Net::DRI::Shell'
512 0 0 if @args
514 0 0 unless ($$ctx{'file_quit'})
519 0 0 if handle_line($ctx, $l)
523 0 0 if (exists $$ctx{'term_features'}{'writeHistory'} and defined $HISTORY)
544 0 0 unless defined $$ctx{'record_filehandle'}
545 0 0 if @args == 1 and $args[0] eq '.' || $args[0] eq "\n"
547 0 0 defined $l ? :
557 0 0 unless open my $ch, '<', $file
561 0 0 if $l =~ /^\s*$/ or $l =~ /^#/
565 0 0 if (handle_line($ctx, $l))
571 0 0 unless close $ch
578 0 0 if $l =~ /^\s*$/
583 0 0 if $l eq 'quit' or $l eq 'q' or $l eq 'exit'
590 0 0 if defined $rc and $l =~ /^(?:(?:domain|contact|host)_?(?:check|info|create)|domain_renew) / && (!defined($msg) || index($msg, 'on average') == -1) && $rc->is_success || $$ctx{'config'}{'verbose'} == 1
594 0 0 if (not $ok) { }
597 0 0 if ref $err eq 'XML::LibXML::Error'
598 0 0 ref $err ? :
602 0 0 if (defined $rc)
606 0 0 if defined $msg
607 0 0 if (defined $rc and $rc->is_closing and $$ctx{'dri'}->transport->has_state)
625 0 0 if ($start == 0)
633 0 0 if ($cmd eq 'show')
634 0 0 if ($cmd eq 'set')
635 0 0 unless $$ctx{'completion'}{'files'}{$b} <=> $$ctx{'completion'}{'files'}{$a}
0 0 if ($cmd eq 'run' or $cmd eq 'record')
637 0 0 if ($cmd eq 'add' or $cmd eq 'add_registry' or $cmd eq 'add_current_profile' or $cmd eq 'add_profile')
639 0 0 if (substr($line, $start - 9, 9) eq 'registry=') { }
0 0 elsif (substr($line, $start - 5, 5) eq 'type=') { }
649 0 0 defined $$ctx{'dri'}->registry_name ? :
654 0 0 if $cmd eq 'add_registry'
655 0 0 if $cmd =~ /^add_(?:current_)?profile$/
656 0 0 if $cmd eq 'add'
661 0 0 if ($cmd eq 'target')
664 0 0 if (my($reg) = $line =~ /^target\s+(\S+)\s+\S*$/) { }
0 0 elsif ($line =~ /^target\s+\S*$/) { }
666 0 0 exists $$regs{$reg} ? :
675 0 0 if (substr($line, $start - 9, 9) eq 'duration=')
677 0 0 unless defined $$ctx{'dri'}->registry_name
684 0 0 if ($d > 0)
686 0 0 if ($d > 0)
692 0 0 if ($line =~ /^domain_\S+\s+\S*$/)
695 0 0 if (defined $$ctx{'dri'}->registry)
701 0 0 if ($idx >= 0)
707 0 0 unless ($$ctx{'completion'}{'domains'}{$b} || 0) <=> ($$ctx{'completion'}{'domains'}{$a} || 0)
713 0 0 if ($$ctx{'dri'}->registry_name and $$ctx{'dri'}->available_profile and $$ctx{'dri'}->protocol)
715 0 0 if $$ctx{'dri'}->protocol->can('core_contact_types')
720 0 0 if ($cmd eq 'domain_create')
722 0 0 if (substr($line, $start - 3, 3) eq 'ns=') { }
0 0 elsif (grep {substr($line, $start - (1 + length($_)), 1 + length($_)) eq $_ . '=';} @ct) { }
738 0 0 if ($cmd eq 'domain_update')
740 0 0 if (substr($line, $start - 4, 4) =~ /^[-+]ns=$/) { }
0 0 elsif (grep {substr($line, $start - (1 + length($_)), 1 + length($_)) eq $_ . '=';} @ct) { }
0 0 elsif (substr($line, $start - 8, 8) =~ /^[-+]status=$/) { }
753 0 0 unless (defined $o)
761 0 0 if (/^([+-])contact$/) { }
765 0 0 if ($line =~ /^domain_update_ns_\S+\s+\S+\s+\S*/)
767 0 0 if ($line =~ /^(?:domain|host|contact)_update_status_\S+\s+\S+\s+\S*/)
770 0 0 unless (defined $o)
775 0 0 if ($line =~ /^domain_update_contact_\S+\s+\S+\s+\S*/)
777 0 0 if (my($trans) = $line =~ /^domain_transfer_(\S+)\s+\S+\s+\S*/)
780 0 0 if $trans eq 'start'
784 0 0 if ($cmd eq 'contact_create')
786 0 0 unless defined $$ctx{'dri'}->registry_name and defined $$ctx{'dri'}->profile
788 0 0 unless (defined $c)
792 0 0 if ($line =~ /^contact_\S+\s+\S*$/)
794 0 0 if ($cmd eq 'contact_update')
796 0 0 unless defined $$ctx{'dri'}->registry_name and defined $$ctx{'dri'}->profile
799 0 0 defined $c ? :
802 0 0 if ($line =~ /^host_\S+\s+\S*$/)
803 0 0 if (my($h) = $line =~ /^host_update_name_set\s+\S+\s+(\S*)$/)
804 0 0 if ($cmd eq 'host_update')
806 0 0 if (substr($line, $start - 5, 5) eq 'name=') { }
0 0 elsif (substr($line, $start - 8, 8) =~ /^[-+]status=$/) { }
814 0 0 unless (defined $o)
832 0 0 unless defined $capa and exists $$capa{$what}
838 0 0 if ($t eq 'add') { }
0 0 elsif ($t eq 'del') { }
0 0 elsif ($t eq 'set') { }
844 0 0 unless $$ctx{'completion'}{'hosts'}{$b} <=> $$ctx{'completion'}{'hosts'}{$a}
850 0 0 if defined $$ctx{'completion'}{'contacts'}{$_}[1]
0 0 if (defined $creg)
851 0 0 unless $$ctx{'completion'}{'contacts'}{$b}[0] <=> $$ctx{'completion'}{'contacts'}{$a}[0]
861 0 0 unless defined $params
869 0 0 if (exists $p{$n}) { }
871 0 0 unless ref $p{$n} eq 'ARRAY'
882 0 0 unless exists $p{$tk}
887 0 0 if $cmd =~ /^!/
888 0 0 if $cmd eq 'help'
889 0 0 if $cmd eq 'run'
890 0 0 if $cmd eq 'record'
891 0 0 if $cmd =~ /^message_(?:retrieve|delete)$/ or $cmd eq 'ping'
892 0 0 if $cmd =~ /^domain_(?:check)$/
893 0 0 if $cmd =~ /^domain_transfer_(?:start|stop|query|accept|refuse)$/
894 0 0 if $cmd eq 'domain_update'
895 0 0 if $cmd =~ /^domain_update_ns_(?:add|del|set)$/
896 0 0 if $cmd =~ /^domain_update_status_(?:add|del|set)$/
897 0 0 if $cmd =~ /^domain_update_contact_(?:add|del|set)$/
899 0 0 if ($cmd eq 'domain_info')
902 0 0 if (defined $r[0] and $r[0]->is_success)
905 0 0 if (defined $ns)
907 0 0 if (defined $ns)
909 0 0 if (defined $cs)
920 0 0 if ($cmd =~ /^host_(?:create|delete|info|check|update|update_(?:ip|status|name)_(?:add|del|set))$/)
922 0 0 unless $$ctx{'dri'}->has_object('ns')
926 0 0 if ($cmd =~ /^contact_(?:create|delete|info|check|update|update_status_(?:add|del|set)|transfer_(?:start|stop|query|accept|refuse))$/)
928 0 0 unless $$ctx{'dri'}->has_object('contact')
930 0 0 if ($cmd eq 'contact_create' and defined $r[0] and $r[0]->is_success)
933 0 0 if (defined $id)
941 0 0 if exists &$sub
945 0 0 if $cmd =~ /^domain_\S+/
956 0 0 defined $out ? :
1042 0 0 if (defined $$ctx{'record_filehandle'})
1049 0 0 if (defined $n and $n)
1052 0 0 unless open my $fh, '>', $n
1058 0 0 $m ? :
1072 0 0 unless Net::DRI::Util::has_key($rh, 'registry') and Net::DRI::Util::has_key($rh, 'type')
1075 0 0 unless (defined $r[0] and $r[0]->is_success)
1076 0 0 unless (exists $$rh{'name'} and defined $$rh{'name'})
1089 0 0 unless Net::DRI::Util::has_key($rh, 'registry')
1092 0 0 unless (grep {$reg eq $_;} $$ctx{'dri'}->available_registries)
1109 0 0 unless Net::DRI::Util::has_key($rh, 'name') and Net::DRI::Util::has_key($rh, 'type')
1112 0 0 defined $$rh{'protocol'} ? :
1115 0 0 if ($rc->is_success and $cmd eq 'add_current_profile')
1129 0 0 unless @$ra
1130 0 0 if ($$ra[0] eq 'profiles') { }
0 0 elsif ($$ra[0] eq 'tlds') { }
0 0 elsif ($$ra[0] eq 'periods' or $$ra[0] eq 'durations') { }
0 0 elsif ($$ra[0] eq 'objects') { }
0 0 elsif ($$ra[0] eq 'types') { }
0 0 elsif ($$ra[0] eq 'status') { }
0 0 elsif ($$ra[0] eq 'config') { }
1153 0 0 defined $o ? :
1194 0 0 unless defined $e
1195 0 0 $e ? :
1202 0 0 unless defined $e
1213 0 0 ref $$rh{'status'} ? :
0 0 if exists $$rh{'status'}
1214 0 0 if exists $$rh{'contact'}
1231 0 0 unless defined $e
1232 0 0 $e ? :
1240 0 0 if exists $$rh{'contact'}
1279 0 0 ref $ids ? :
1294 0 0 ref $$rh{'ns'} ? :
0 0 if exists $$rh{'ns'}
1296 0 0 if $$ctx{'dri'}->protocol and $$ctx{'dri'}->protocol->can('core_contact_types')
1300 0 0 unless exists $$rh{$t}
1304 0 0 if %c
1314 0 0 if (exists $$rh{'current_expiration'})
1334 0 0 if ($cmd eq 'host_create') { }
0 0 elsif ($cmd =~ /^host_update_ip_(?:add|del|set)$/) { }
0 0 elsif ($cmd =~ /^host_update_status_(?:add|del|set)$/) { }
0 0 elsif ($cmd eq 'host_update') { }
1350 0 0 ref $$radd{$k} ? :
0 0 if ($k eq 'ip')
0 0 if (keys %$radd)
1351 0 0 ref $$rdel{$k} ? :
0 0 if ($k eq 'ip')
0 0 if (keys %$rdel)
1352 0 0 if (keys %$rset)
1353 0 0 if exists $$rset{'name'}
1360 0 0 if $cmd eq 'host_update_name_set'
1370 0 0 if ($cmd eq 'contact_create') { }
0 0 elsif ($cmd =~ /^contact_update_status_(?:add|del|set)$/) { }
0 0 elsif ($cmd eq 'contact_update') { }
1372 0 0 if exists $$rh{'street'} and not ref $$rh{'street'}
1373 0 0 if exists $$rh{'id'} and not exists $$rh{'srid'}
1374 0 0 if @$ra and not $$ra[0] =~ /=/ and not exists $$rh{'srid'}
1389 0 0 if (keys %$rset)
1395 0 0 if (keys %$radd)
1396 0 0 if (keys %$rdel)
1413 0 0 unless defined $dom and length $dom
1416 0 0 if ($dom =~ /`.+`/) { }
0 0 elsif ($dom =~ m[/]) { }
1420 0 0 unless open $fin, '-|', $dom
1421 0 0 unless open $fout, '>', $res
1424 0 0 unless -e $dom and -r _
1426 0 0 unless open $fin, '<', $dom
1427 0 0 unless open $fout, '>', $res
1430 0 0 unless (defined $fin and defined $fout)
1433 0 0 unless Net::DRI::Util::is_hostname($dom)
1437 0 0 $cmd eq 'domain_check' || $cmd eq 'domain_info' ? :
1445 0 0 if (Net::DRI::Util::is_hostname($l)) { }
1449 0 0 if $withinfo
1469 0 0 if ($cmd eq 'domain_check') { }
0 0 elsif ($cmd eq 'domain_info') { }
1472 0 0 defined $$rh{'exist'} ? :
0 0 defined $$rh{'exist_reason'} ? :
1477 0 0 if (exists $$rh{'ns'})
1478 0 0 if (exists $$rh{'contact'})
1500 0 0 ref $ids ? :
1516 0 0 if (exists $$rh{'srid'})
1517 0 0 if (exists $$rh{'id'})
1538 0 0 if $o =~ /[a-z]/i
1539 0 0 if $i >= 0
1553 0 0 unless exists $$rd{'auth'} and not ref $$rd{'auth'}
1561 0 0 unless exists $$rd{'duration'}
1563 0 0 unless defined $v and defined $u
1564 0 0 if $u =~ /^y(?:ears?)?$/i
1565 0 0 if $u =~ /^m(?:onths?)?$/i
1575 0 0 ref $$rd{$k} ? :
1576 0 0 ref $$rd{$k} ? :
1580 0 0 if $$ctx{'dri'}->protocol and $$ctx{'dri'}->protocol->can('core_contact_types')
1590 0 0 unless %c
1593 0 0 if exists $$rd{'registrant'}
1614 0 0 unless (ref $v)
1616 0 0 unless defined $v
1618 0 0 unless $v =~ /^<\?xml /
1623 0 0 if ref $v eq 'ARRAY'
1624 0 0 if ref $v eq 'HASH'
1625 0 0 $full ? :
0 0 if $v->isa('Net::DRI::Data::Hosts')
1626 0 0 $full ? :
0 0 if $v->isa('Net::DRI::Data::Contact')
1627 0 0 if ($v->isa('Net::DRI::Data::ContactSet'))
1634 0 0 $full ? :
1636 0 0 $full ? :
0 0 if $v->isa('Net::DRI::Data::StatusList')
1637 0 0 $full ? :
0 0 if $v->isa('Net::DRI::Protocol::ResultStatus')
1638 0 0 $full ? :
0 0 if $v->isa('DateTime')
1639 0 0 $full ? :
0 0 if $v->isa('DateTime::Duration')
1651 0 0 if $k1 eq 'session' and $k2 eq 'exchange' and $$ctx{'config'}{'verbose'} == 0