Branch Coverage

blib/lib/POE/Component/IRC.pm
Criterion Covered Total %
branch 145 338 42.9


line true false branch
29 79 0 if $POE::Component::Client::DNS::VERSION >= 0.99
33 0 0 if $POE::Filter::Zlib::Stream::VERSION >= 1.96
40 0 79 if (not $GOT_SOCKET6)
46 0 0 if (not $GOT_SOCKET6)
160 205 0 if (ref $args eq 'HASH' and keys %{$args;})
166 0 205 if ($ENV{'POCOIRC_DEBUG'})
171 0 205 if ($self->{'debug'})
176 0 205 if ($self->{'useipv6'} and not $GOT_SOCKET6)
180 0 205 if ($self->{'usessl'} and not $GOT_SSL)
184 2 203 if exists $self->{'nataddr'}
185 0 205 if exists $self->{'dccports'}
187 115 90 unless $self->{'port'}
188 115 90 unless defined $self->{'msg_length'}
190 0 205 if ($self->{'use_localaddr'})
192 0 0 $self->{'localport'} ? :
197 115 90 unless (defined $self->{'nick'})
202 115 90 unless (defined $self->{'username'})
207 115 90 unless (defined $self->{'ircname'})
212 0 113 unless (defined $self->{'server'} or $spawned)
213 0 0 unless $ENV{'IRCSERVER'}
217 0 205 if (defined $self->{'webirc'})
218 0 0 if (!ref($self->{'webirc'}) ne 'HASH')
222 0 0 unless (exists $self->{'webirc'}{$expect_key})
245 0 2575 unless $ev->{'name'}
246 96 2479 if $self->{'raw'}
249 90 2485 if ($ev->{'name'} eq '001')
256 12 2563 if ($ev->{'name'} =~ /^irc_ctcp_(.+)$/)
312 90 0 if ($GOT_SOCKET6)
319 90 0 unless ($localaddr)
326 0 90 if ($self->{'socks_proxy'})
335 0 0 unless ($self->{'socket'})
342 0 0 if (_ip_is_ipv4($self->{'server'})) { }
359 0 0 if ($GOT_SSL and $self->{'usessl'})
363 0 0 if ($self->{'sslctx'}) { }
0 0 elsif ($self->{'sslkey'} and $self->{'sslcert'}) { }
379 0 0 if ($@)
386 0 90 if ($self->{'compress'})
401 90 0 if ($self->{'socket'}) { }
413 0 90 if ($self->{'proxy'})
434 0 0 if (length $input != 8)
445 0 0 if (@resp != 4 or $resp[0] ne '0' or not $resp[1] =~ /^(?:90|91|92|93)$/)
455 0 0 if ($resp[1] eq '90') { }
495 0 90 if (defined $self->{'webirc'})
501 1 89 if (defined $self->{'password'})
513 0 90 defined $self->{'bitmode'} ? :
568 0 9 if ($state eq 'whois' and @args > 1) { }
0 9 elsif ($state eq 'part' and @args > 1) { }
573 0 0 unless $self->isupport('CHANTYPES')
575 0 0 if ($args[-1] =~ / +/ or not $args[-1] =~ /^[$chantypes]/)
579 0 0 if defined $message
587 9 0 if defined $args
598 90 1 if ($args)
600 0 90 if ref $args eq 'ARRAY'
601 90 0 if ref $args eq 'HASH'
606 0 91 if ($self->{'resolver'} and $self->{'res_addresses'} and @{$self->{'res_addresses'};})
613 0 91 if ($self->{'resolver'} and not _ip_get_version($self->{'server'}) and not $self->{'nodns'}) { }
618 0 0 $self->{'useipv6'} && $GOT_SOCKET6 ? :
639 0 0 if $response
649 0 91 if $self->{'socket'}
651 0 91 if ($self->{'socks_proxy'} and not $self->{'socks_port'})
656 455 0 unless $self->{$address} and _ip_is_ipv6($self->{$address})
657 0 0 unless ($GOT_SOCKET6)
672 0 91 $self->{'use_localaddr'} ? :
687 0 0 unless (defined $net_dns_packet)
695 0 0 unless $net_dns_answer->type =~ /^A/
699 0 0 if (not @{$self->{'res_addresses'};} and $type eq 'AAAA')
704 0 0 unless (@{$self->{'res_addresses'};})
709 0 0 if (my $address = shift @{$$self{'res_addresses'};})
724 0 27 unless (defined $to and defined $message)
733 6 21 $state eq 'ctcpreply' ? :
744 0 0 unless (@nicks)
754 0 0 if (length($tmp) + length($nick) >= 509)
770 0 6 unless (defined $chan and defined $nick)
775 6 0 if defined $message
785 0 0 unless (defined $chan and defined $nick)
790 0 0 if defined $message
802 0 0 if defined $version and $version =~ /ratbox/i
803 0 0 if defined $args
812 0 0 if @_ & 1
815 0 0 unless (defined $alias)
828 0 115 if @_ & 1
832 115 0 if ref $params{'options'} ne 'HASH'
837 0 115 if ($ENV{'POCOIRC_DEBUG'})
856 94 21 $plugin_debug ? :
0 115 ref $options eq 'HASH' ? :
864 114 1 if (not $params{'nodns'} and $GOT_CLIENT_DNS and not $self->{'resolver'})
879 0 0 if (defined $arg)
895 0 0 if $state eq 'sconnect'
897 0 0 if (defined $arg)
898 0 0 if $arg =~ /\x20/
912 53 100 if (defined $_[10])
914 3 50 if $arg =~ /\x20/
928 0 87 unless (defined $one)
934 87 0 if defined $two
945 0 9 unless (defined $arg)
951 0 9 if $arg =~ /\x20/
963 0 1 unless (defined $one and defined $two)
969 0 1 if $two =~ /\x20/
985 0 93 unless (defined $to and defined $msg)
990 3 90 if ref $to eq 'ARRAY'
1000 1 115 if $self->{'_shutdown'}
1003 1 114 if ($self->logged_in) { }
0 114 elsif ($self->connected) { }
1005 1 0 unless defined $msg
1006 1 0 unless defined $timeout
1007 0 1 if $msg =~ /\x20/
1034 114 1 if $self->{'resolver'} and $self->{'mydns'}
1074 1032 0 if (my($event) = $args[0] =~ /^(\w+)/) { }
1076 0 1032 if $self->send_user_event($event, \@args) == 4
1084 91 941 if $self->{'send_time'} < $now
1089 0 1032 if (&bytes::length($msg) > $self->{'msg_length'} - &bytes::length(scalar $self->nick_name))
1093 0 1032 if (not $self->{'flood'} and @{$self->{'send_queue'};}) { }
3 1029 elsif (not $self->{'flood'} and $self->{'send_time'} - $now >= 10 or not defined $self->{'socket'}) { }
1104 0 1029 if $self->{'debug'}
1105 39 990 if $self->{'raw'}
1120 1 92 unless defined $self->{'socket'}
1123 0 92 if $self->{'send_time'} < $now
1127 0 2 if $self->{'debug'}
1128 0 2 if $self->{'raw'}
1133 1 91 if (@{$self->{'send_queue'};})
1147 121 0 if defined $args
1156 5 1 if @args
1158 5 1 if (defined $topic)
1160 5 0 if length $topic
1171 0 0 unless (@nicks)
1223 0 0 if (defined $self->{'send_queue'} and ref $self->{'send_queue'} eq 'ARRAY')
1231 0 4 unless defined $value
1243 3 117 if $self->{'INFO'}{'LoggedIn'}
1250 90 0 unless $GOT_ZLIB
1251 0 0 unless defined $value
1253 0 0 if ($value) { }
1254 0 0 unless $self->{'uplink'}
1258 0 0 if $self->{'uplink'}
1268 90 0 unless $GOT_ZLIB
1269 0 0 unless defined $value
1271 0 0 if ($value) { }
1272 0 0 unless $self->{'downlink'}
1276 0 0 if $self->{'uplink'}
1307 1 89 if ($self->{'_waiting'})
1312 1 89 if $self->{'_shutdown'}
1337 6 4 if $nick eq $self->{'INFO'}{'RealNick'}
1345 0 0 if $text eq 'IDENTIFY-MSG'
1353 2 1 if ($cmd eq 'ACK')
1354 0 2 ${$_[1];} eq '*' ? :
1357 1 1 if (grep {$_ =~ /^=?identify-msg$/;} @enabled)
1360 0 2 if (grep {$_ =~ /^-identify-msg$/;} @enabled)
1371 0 90 if $isupport->isupport('CAPAB')
1372 0 90 if $isupport->isupport('NAMESX')
1373 0 90 if $isupport->isupport('UHNAMES')
1393 0 91 unless defined $ip
1396 91 0 if not $ip =~ /:/ and _ip_is_ipv4($ip)
1399 0 0 if _ip_is_ipv6($ip)
1406 0 91 unless defined $ip
1409 0 91 unless $ip =~ /^[\d\.]+$/
1410 0 91 if $ip =~ /^\./
1411 0 91 if $ip =~ /\.$/
1414 0 91 if $ip =~ /^(\d+)$/ and $1 < 256
1420 0 91 if $n <= 0 or $n > 4
1423 0 91 if $ip =~ /\.\./
1427 0 364 if $quad < 0 or $quad >= 256
1434 0 91 unless defined $ip
1438 91 0 if $n <= 0 or $n >= 8
1447 0 0 if $octet eq ''
1450 0 0 if $octet =~ /^[a-f\d]{1,4}$/i
1453 0 0 if ($k == $n + 1)
1454 0 0 if ip_is_ipv4($octet)
1461 0 0 if $ip =~ /^:[^:]/
1464 0 0 if $ip =~ /[^:]:$/
1467 0 0 if $ip =~ s/:(?=:)//g > 1