Branch Coverage

blib/lib/Net/SIP/Packet.pm
Criterion Covered Total %
branch 80 136 58.8


line true false branch
45 176 392 if @_ > 1
46 9 383 if @_ and not ref $_[0]
48 383 0 if @_
84 176 0 if (UNIVERSAL::isa($header, 'HASH'))
88 321 665 ref $v ? :
95 64 112 $code =~ /^\d/ ? :
98 176 0 defined $text ? :
108 0 836 if (UNIVERSAL::isa($h, 'Net::SIP::HeaderPair')) { }
114 0 836 unless defined $value
115 0 836 if $normalized
123 52 124 if (ref $body)
124 52 0 unless ($self->get_header('content-type'))
126 52 0 if $sub
147 68 139 $data->{'method'} ? :
158 0 0 unless $self->{'header'}
169 0 0 unless $self->{'header'}
219 5960 0 if ($key) { }
223 4476 38302 if $h->{'key'} eq $key
225 1957 4003 if wantarray
226 0 4003 if (@v > 1)
231 0 0 if keys %v == 1
259 9 0 if ($key) { }
264 3 56 if $h->{'key'} eq $key
266 9 0 if wantarray
267 0 0 if @v > 1
288 0 3 ref $val ? :
304 0 304 ref $val ? :
336 5 84 ref $val ? :
351 0 0 if (ref $body)
352 0 0 unless ($self->get_header('content-type'))
354 0 0 if $sub
375 66 0 @_ > 1 ? :
378 0 66 ref $sub eq 'CODE' ? :
382 582 67 if $key and $h->{'key'} ne $key
404 0 316 if (defined $cl and $cl != length $body)
409 13 303 if $self->{'as_string'}
416 0 303 if (my $lines = $self->{'lines'})
418 0 0 unless $lines->[$i]
423 0 0 defined $line && $line == $i ? :
425 0 0 if (@hi == $count) { }
0 0 elsif (@hi) { }
453 223 80 $self->{'method'} ? :
459 303 0 unless defined $cl
474 149 3 if (not $level) { }
475 149 0 if ($self->is_request) { }
477 105 44 $body ? :
480 0 0 $body ? :
505 0 7977 unless ($self->{'header'})
509 5041 2936 if $self->{'method'}
596 0 253 unless $v =~ /^(\d+)\s*$/
606 5 597 if ($quote) { }
226 371 elsif ($v =~ /\G(.*?)([\\"<,])/cg) { }
607 5 0 if ($v =~ /\G(.*?)(\\|$quote)/cg) { }
608 0 5 if ($2 eq '\\') { }
620 5 221 if ($2 eq '\\') { }
216 5 elsif ($2 eq ',') { }
626 216 0 unless $quote
630 5 0 $2 eq '<' ? :
650 139 74 if ($header[0] =~ m[^SIP/2.0\s+(\d+)\s+(\S.*?)\s*$]) { }
74 0 elsif ($header[0] =~ m[^(\w+)\s+(\S.*?)\s+SIP/2\.0\s*$]) { }
672 0 1547 unless my($k, $v) = $header[0] =~ /^([^\s:]+)\s*:\s*(.*)/
683 1330 217 $parse ? :
684 54 1493 if (@v > 1) { }
691 75 1472 if (my $k2c = $key2check->{$nk})
694 1122 425 if ($once{$nk})
721 0 60 if $ct and lc $ct ne 'application/sdp'
743 0 0 if $self->{'as_string'}
754 490 0 if $self->{'header'}