| 1 | package Net::WebSocket::X::BadHeader; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use parent qw( Net::WebSocket::X::Base ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | ▶ | sub _new { | ||||||||||||||||||||||||||
|
Subroutine
_new: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||
| 9 | 3 | my ($class, $name => $value, $why) = @_; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 3 | my @args = ( | |||||||||||||||||||||||||||
| 12 | name => $name, | ||||||||||||||||||||||||||||
| 13 | value => $value, | ||||||||||||||||||||||||||||
| 14 | why => $why, | ||||||||||||||||||||||||||||
| 15 | ); | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 3 | ▶ | my $value_str = defined($value) ? $value : q<>; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | #Perl 5.10 still warns on length(undef) | ||||||||||||||||||||||||||||
| 20 | 3 | ▶ | my $str = defined($why) && length($why) ? "Bad “$name” header ($value_str): $why" : "Bad “$name” header ($value_str)"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $why and length $why
MC/DC50%1/2
defined $why and length $why
defined $why
length $why
Truth table66%2/3
A and B
A= defined $whyB= length $why
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 3 | return $class->SUPER::_new( $str, @args ); | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | 1; | |||||||||||||||||||||||||||