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")
112 0 4 if ($err) { }
113 0 0 if $err eq "die"
148 0 0 unless ref $_->{'timing'} and $time % 60 == 0 and $_->{'timing'}->match($time)
243 0 0 if ref $self->{'disconnect'} eq "CODE"
260 0 0 if ($self->{'encoding'})
262 0 0 if $charset and $charset eq $self->{'encoding'}
266 0 0 if $line =~ /^:\S+\s\d{3}\s/u and @{$self->{'numerics'};} < 100
268 0 0 if ($line =~ /^>>>\sNICK\s(.*)/u) { }
0 0 elsif ($line =~ /^:\S+\s433\s/u) { }
281 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) { }
291 0 0 if $self->{'in'}{'command'} eq "JOIN" or $self->{'in'}{'command'} eq "PART"
311 0 0 unless $self->{'in'}{'nick'} ne $self->{'nick'}
313 0 0 if ($self->{'in'}{'command'} eq "PRIVMSG")
314 0 0 if $self->{'in'}{'forum'} and $self->{'in'}{'forum'} eq $self->{'nick'}
319 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'}
322 0 0 if ($self->{'in'}{'to_me'})
323 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) { }
352 0 0 if ($m->{'passwd'} and $passwd and $m->{'passwd'} eq $passwd)
420 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}
424 0 0 if keys %+
440 0 0 if $rv
449 0 7 if (ref $plugin) { }
450 0 7 if ($plugin =~ /^:core$/iu)
476 16 6 if ($@) { }
481 0 16 unless $@ =~ /^Can't locate $path/u
484 1 6 unless $namespace
486 0 6 if $self->{'loaded'}{$namespace}
488 0 6 if $namespace->can("import")
489 0 6 unless $namespace->can("init")
492 0 6 if $@
523 0 3 if ref $attr->{'subs'} eq "HASH"
524 0 3 if ref $attr->{'helps'} eq "HASH"
551 3 0 $timing =~ /^\d+$/u ? :
567 0 9 if (@_ % 2)
591 2 2 unless $name
592 0 4 defined $self->{'vars'}{$name} ? :
597 1 0 defined $name ? :
603 0 1 if ($self->{'in'}{'forum'}) { }
605 0 0 $self->{'in'}{'forum'} eq $self->{'nick'} ? :
617 0 0 !$self->{'in'}{'private'} ? :
622 0 1 $message =~ s[^/me\s+][]u ? :
640 1 0 if ($nick)
652 0 0 ref $self->{'connect'}{'join'} eq 'ARRAY' ? :
0 0 !@_ && $self->{'connect'}{'join'} ? :
675 1 1 if (@list > 2) { }
1 0 elsif (@list > 1) { }