Die/send.pm

filter: Statementstmt 92.3% 12 / 13 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 89.4% 17 / 19 CC 3 SCAR 9.3
CC
3
Cov
88%
send
3.0
BEGIN
1.0
CRAP 2.5
« Die/kill.pm ↑ Summary Die/binmode.pm »
1 package IO::Die;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 6 ▶sub send {
Subroutine send: called CC=3 SCAR=11.1
6 6 my ( $NS, $socket, $flags, $to ) = ( shift, shift, @_[ 1 .. $#_ ] );
7  
8 #https://github.com/pjcj/Devel--Cover/issues/125
9 #my ( $NS, $socket, $msg_r, $flags, $to ) = ( shift, shift, \shift, @_ );
10  
11 6 local ( $!, $^E );
12 6 my $res;
13 6 ▶ if ( defined $to ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $to) { } 0 6 6
14 0 $res = CORE::send( $socket, $_[0], $flags, $to );
15 }
16 else {
17 6 $res = CORE::send( $socket, $_[0], $flags );
18 }
19  
20 6 ▶ if ( !defined $res ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $res) 3 3 6
21 3 $NS->__THROW( 'SocketSend', length => length( $_[0] ), flags => $flags );
22 }
23  
24 3 return $res;
25 }
26  
27 3 1;
« Die/kill.pm ↑ Summary Die/binmode.pm »