Branch Coverage

blib/lib/Bot/IRC.pm
Criterion Covered Total %
branch 38 128 29.6


line true false branch
21 0 17 if @_ % 2
23 1 16 unless ref $self->{'connect'} eq "HASH" and $self->{'connect'}{'server'}
50 0 16 if $self->{'send_user_nick'} ne "on_connect" and $self->{'send_user_nick'} ne "on_parent" and $self->{'send_user_nick'} ne "on_reply"
55 2 0 ref $self->{'plugins'} eq 'ARRAY' ? :
2 14 if $self->{'plugins'}
68 0 1 $self->{'connect'}{'ssl'} ? :
0 1 $self->{'connect'}{'ipv6'} ? :
0 1 unless $self->{'socket'} = ($self->{'connect'}{'ssl'} ? "IO::Socket::SSL" : "IO::Socket::IP")->new("PeerAddr", $self->{'connect'}{'server'}, "PeerPort", $self->{'connect'}{'port'}, "Proto", "tcp", "Family", $self->{'connect'}{'ipv6'} ? 10 : 2, "Type", 1, "SSL_verify_mode", 0)
73 1 0 if ($self->{'encoding'})
80 0 1 if ($self->{'send_user_nick'} eq "on_connect")
111 0 4 if ($err) { }
112 0 0 if $err eq "die"
147 0 0 unless ref $_->{'timing'} and $time % 60 == 0 and $_->{'timing'}->match($time)
240 0 0 if ref $self->{'disconnect'} eq "CODE"
257 0 0 if ($self->{'encoding'})
259 0 0 if $charset and $charset eq $self->{'encoding'}
263 0 0 if $line =~ /^:\S+\s\d{3}\s/u and @{$self->{'numerics'};} < 100
265 0 0 if ($line =~ /^>>>\sNICK\s(.*)/u) { }
0 0 elsif ($line =~ /^:\S+\s433\s/u) { }
278 0 0 if ($line =~ /^(ERROR)\s/u) { }
0 0 elsif ($line =~ /^:(\S+?)!~?(\S+?)@(\S+?)\s(\S+)\s(\S+)\s:(.*)/u) { }
0 0 elsif ($line =~ /^:(\S+?)!~?(\S+?)@(\S+?)\s(\S+)\s:(.*)/u) { }
0 0 elsif ($line =~ /^:(\S+?)!~?(\S+?)@(\S+?)\s(\S+)\s(\S+)\s(.*)/u) { }
0 0 elsif ($line =~ /^:(\S+?)!~?(\S+?)@(\S+?)\s(\S+)\s(\S+)/u) { }
0 0 elsif ($line =~ /^(PING)\s(.+)/u) { }
0 0 elsif ($line =~ /^:(\S+)\s([A-Z]+|\d+)\s(\S+)\s(.*)/u) { }
288 0 0 if $self->{'in'}{'command'} eq "JOIN" or $self->{'in'}{'command'} eq "PART"
308 0 0 unless $self->{'in'}{'nick'} ne $self->{'nick'}
310 0 0 if ($self->{'in'}{'command'} eq "PRIVMSG")
311 0 0 if $self->{'in'}{'forum'} and $self->{'in'}{'forum'} eq $self->{'nick'}
316 0 0 if $self->{'in'}{'text'} =~ s/^\s*\b$self->{'nick'}\b[\s\W]*//iu or $self->{'in'}{'text'} =~ s/[\s\W]*\b$self->{'nick'}\b[\s\W]*$//iu or $self->{'in'}{'private'}
319 0 0 if ($self->{'in'}{'to_me'})
320 0 0 if ($self->{'in'}{'text'} =~ /^\s*help\W*$/iu) { }
0 0 elsif ($self->{'in'}{'text'} =~ /^\s*help\s+(.+?)\W*$/iu) { }
0 0 elsif ($self->{'in'}{'text'} =~ /Sorry. I don't understand./u) { }
349 0 0 if ($m->{'passwd'} and $passwd and $m->{'passwd'} eq $passwd)
417 0 0 unless ref $hook->{'when'}{$type} eq "Regexp" and $self->{'in'}{$type} and $self->{'in'}{$type} =~ /$hook->{'when'}{$type}/u or ref $hook->{'when'}{$type} eq "CODE" and $hook->{'when'}{$type}->($self, $self->{'in'}{$type}, {%{$self->{'in'};}}) or defined $self->{'in'}{$type} and defined $hook->{'when'}{$type} and $self->{'in'}{$type} eq $hook->{'when'}{$type}
421 0 0 if keys %+
436 0 0 if $rv
445 0 7 if (ref $plugin) { }
446 0 7 if ($plugin =~ /^:core$/iu)
472 16 6 if ($@) { }
477 0 16 unless $@ =~ /^Can't locate $path/u
480 1 6 unless $namespace
482 0 6 if $self->{'loaded'}{$namespace}
484 0 6 if $namespace->can("import")
485 0 6 unless $namespace->can("init")
488 0 6 if $@
519 0 3 if ref $attr->{'subs'} eq "HASH"
520 0 3 if ref $attr->{'helps'} eq "HASH"
547 3 0 $timing =~ /^\d+$/u ? :
563 0 9 if (@_ % 2)
587 2 2 unless $name
588 0 4 defined $self->{'vars'}{$name} ? :
593 1 0 defined $name ? :
599 0 1 if ($self->{'in'}{'forum'}) { }
601 0 0 $self->{'in'}{'forum'} eq $self->{'nick'} ? :
613 0 0 !$self->{'in'}{'private'} ? :
618 0 1 $message =~ s[^/me\s+][]u ? :
636 1 0 if ($nick)
648 0 0 ref $self->{'connect'}{'join'} eq 'ARRAY' ? :
0 0 !@_ && $self->{'connect'}{'join'} ? :
671 1 1 if (@list > 2) { }
1 0 elsif (@list > 1) { }