blib/lib/Parallel/parallel_map.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 97.1% 34 / 35 SCAR 11.0
CC
3
Cov
100%
parallel_map
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
↑ Summary
1 package Parallel::parallel_map;
2  
3 79 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 79 our $VERSION = '0.02';
5  
6 79 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 79 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 79 ▶use Parallel::DataPipe;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 79 require Exporter;
11  
12 79 our @ISA = qw(Exporter);
13  
14 79 our @EXPORT = qw(parallel_map);
15  
16  
17 sub parallel_map(&@) {
18 279 ▶ my ($code,@input) = @_;
Subroutine parallel_map: called CC=3 SCAR=11.0
Pod undocumented
19 279 my (@result,@output);
20 279 ▶ if (wantarray) {
Branch: 1 branch
BranchTrueFalseTotal
if (wantarray) 265 14 279
21 265 ▶ @output = (output=>sub {my ($r,$i) = @_;$result[$i] = $r;});
Subroutine __ANON__: called CC=1 SCAR=0.0
22 }
23 Parallel::DataPipe::run {
24 279 input => \@input,
25 process => $code,
26 @output,
27 };
28 201 ▶ return wantarray?@result:();
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 200 1 201
29 }
30  
31 79 1;
32  
33 __END__
↑ Summary