Branch Coverage

blib/lib/POE/Component/IRC/Plugin/DCC.pm
Criterion Covered Total %
branch 80 118 67.8


line true false branch
22 0 116 if @_ & 1
89 0 2 unless ($self->{'dcc'}{$id})
105 1 9 if ($file =~ /[\s"]/)
121 68 10 if ref($_) =~ /REF|SCALAR/
124 1 9 if ($type eq 'ACCEPT' and $self->{'resuming'}{"$port+$nick"}) { }
1 8 elsif ($type eq 'RESUME') { }
131 0 1 if $cookie->{'nick'} ne $nick
132 0 1 if $cookie->{'port'} ne $port
148 0 26 unless $event =~ /^U_dcc(?:_accept|_chat|_close|_resume)?$/
161 0 8 unless (defined $type)
170 5 3 if ($type eq 'CHAT') { }
3 0 elsif ($type eq 'SEND') { }
174 0 3 unless (defined $file)
180 0 3 unless (defined $size)
196 0 8 if ($self->{'dccports'})
198 0 0 unless (defined $bindport)
213 1 7 if $self->{'nataddr'}
215 0 8 unless (defined $addr)
225 3 5 $size ? :
255 0 6 unless (defined $cookie)
260 3 3 if ($cookie->{'type'} eq "SEND")
262 2 1 if defined $myfile
282 0 7 unless (defined $id and @data)
287 0 7 unless (exists $self->{'dcc'}{$id})
292 0 7 unless (exists $self->{'dcc'}{$id}{'wheel'})
297 0 7 if ($self->{'dcc'}{$id}{'type'} ne "CHAT")
311 0 5 unless (defined $id)
316 0 5 unless (exists $self->{'dcc'}{$id})
321 0 5 unless (exists $self->{'dcc'}{$id}{'wheel'})
327 1 4 if ($self->{'dcc'}{$id}{'wheel'}->get_driver_out_octets)
341 0 2 if ($self->{'dcc'}{$id}{'listener'} and $self->{'dccports'})
355 1 0 if defined $myfile
359 1 0 if (open my $handle, '>>', $cookie->{'file'}) { }
377 5 264 if ($self->{'dcc'}{$id}{'alarm_id'})
381 131 138 if ($self->{'dcc'}{$id}{'type'} eq 'GET') { }
131 7 elsif ($self->{'dcc'}{$id}{'type'} eq 'SEND') { }
411 3 128 if ($self->{'dcc'}{$id}{'done'} >= $self->{'dcc'}{$id}{'size'})
413 0 3 if ($self->{'dcc'}{$id}{'listener'} and $self->{'dccports'})
452 5 2 unless (exists $self->{'dcc'}{$id})
453 5 0 if (exists $self->{'wheelmap'}{$id}) { }
463 0 3 if ($self->{'dcc'}{$id}{'listener'} and $self->{'dccports'})
468 0 7 if $errnum != 0
472 3 4 if ($self->{'dcc'}{$id}{'type'} eq "GET")
473 0 3 if ($self->{'dcc'}{$id}{'done'} < $self->{'dcc'}{$id}{'size'})
478 7 0 if ($self->{'dcc'}{$id}{'type'} =~ /^(GET|CHAT)$/)
494 0 0 if ($errnum == 0 and $self->{'dcc'}{$id}{'type'} eq 'GET') { }
498 0 0 $errstr ? :
522 2 0 if (exists $self->{'dcc'}{$id} and not $self->{'dcc'}{$id}{'open'})
553 3 9 $self->{'dcc'}{$id}{'type'} eq 'GET' ? :
6 6 $self->{'dcc'}{$id}{'type'} eq 'CHAT' ? :
564 3 9 if ($self->{'dcc'}{$id}{'type'} eq 'GET') { }
3 6 elsif ($self->{'dcc'}{$id}{'type'} eq 'SEND') { }
566 1 2 $self->{'dcc'}{$id}{'resuming'} ? :
568 0 3 unless (open $handle, $mode, $self->{'dcc'}{$id}{'file'})
577 0 3 unless (open $handle, "<", $self->{'dcc'}{$id}{'file'})
612 3 11 if (exists $self->{'dcc'}{$id}{'alarm_id'})
616 12 2 if (exists $self->{'dcc'}{$id}{'wheel'})
618 0 12 if ($^O =~ /cygwin|MSWin/)
624 3 11 if $self->{'dcc'}{$id}{'type'} eq "GET"