RemoteCommand/Pool.pm

filter: Statementstmt 50.0% 9 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 36.3% 12 / 33 CC 3 SCAR 15.5
CC
3
Cov
45%
remove
12.0
new
2.0
all
2.0
CRAP 4.7
« RemoteCommand/Select.pm ↑ Summary RemoteCommand/Util.pm »
1 package App::RemoteCommand::Pool;
2 1 ▶use v5.24;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental qw(lexical_subs signatures);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub new ($class) {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
7 0 bless {
8 pool => [],
9 }, $class;
10 }
11  
12 0 ▶sub all ($self) {
Subroutine all: not called CC=1 SCAR=6.9
Pod undocumented
13 0 $self->{pool}->@*;
14 }
15  
16 0 ▶sub add ($self, $ssh) {
Subroutine add: not called CC=1 SCAR=6.9
Pod undocumented
17 0 push $self->{pool}->@*, $ssh;
18 0 $self;
19 }
20  
21 0 ▶sub remove ($self, $ssh) {
Subroutine remove: not called CC=3 SCAR=24.8
Pod undocumented
22  
23 0 for my $i (0..$self->{pool}->$#*) {
24 0 ▶ if ($self->{pool}[$i] eq $ssh) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"pool"}[$i] eq $ssh) 0 0 0
25 0 return splice $self->{pool}->@*, $i, 1;
26 }
27 }
28 0 return;
29 }
30  
31 0 ▶sub count ($self) {
Subroutine count: not called CC=1 SCAR=6.9
Pod undocumented
32 0 scalar $self->{pool}->@*;
33 }
34  
35 1 1;
« RemoteCommand/Select.pm ↑ Summary RemoteCommand/Util.pm »