Furl/ConnectionCache.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 90.6% 29 / 32 CC 2 SCAR 2.5
CC
2
Cov
100%
steal
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Furl.pm ↑ Summary
1 package Furl::ConnectionCache;
2 48 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 48 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 48 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 36 ▶sub new { bless [''], shift }
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
7  
8 69 ▶sub steal {
Subroutine steal: called CC=2 SCAR=6.9
Pod undocumented
9 69 my ($self, $host, $port) = @_;
10 69 ▶ if ($self->[0] eq "$host:$port") {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->[0] eq "${host}:$port") { } 26 43 69
11 26 my $sock = $self->[1];
12 26 @{$self} = ('');
13 26 return $sock;
14 } else {
15 43 return undef;
16 }
17 }
18  
19 41 ▶sub push {
Subroutine push: called CC=1 SCAR=0.0
Pod undocumented
20 41 my ($self, $host, $port, $sock) = @_;
21 41 $self->[0] = "$host:$port";
22 41 $self->[1] = $sock;
23 }
24  
25 48 1;
26  
« Furl.pm ↑ Summary