| 1 | ############################################################################### | ||||||||||||||||||||||||||||
| 2 | ## ---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 3 | ## Common API for MCE::Shared::{ Array, Cache, Hash, Minidb, Ordhash }. | ||||||||||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||||||||||
| 5 | ############################################################################### | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 15 | ▶ | use 5.010001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 15 | ▶ | no warnings qw( threads recursion uninitialized numeric ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | package MCE::Shared::Common; | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 15 | our $VERSION = '1.894'; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | # pipeline ( [ func1, @args ], [ func2, @args ], ... ) | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub pipeline { | ||||||||||||||||||||||||||
|
Subroutine
pipeline: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | my $tmp; $tmp = pop if ( defined wantarray ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | while ( @_ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | my $cmd = shift; next unless ( ref $cmd eq 'ARRAY' ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if ( my $code = $self->can(shift @{ $cmd }) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 0 | $code->($self, @{ $cmd }); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if ( defined $tmp ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 0 | my $code; | |||||||||||||||||||||||||||
| 33 | 0 | return ( ref $tmp eq 'ARRAY' && ( $code = $self->can(shift @{ $tmp }) ) ) | |||||||||||||||||||||||||||
| 34 | 0 | ▶ | ? $code->($self, @{ $tmp }) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $tmp eq "ARRAY" and $code = $self->can(shift @{$tmp;})
MC/DC0%0/2
ref $tmp eq "ARRAY" and $code = $self->can(shift @{$tmp;})
ref $tmp eq "ARRAY"
$code = $self->can(shift @{$tmp;})
Truth table0%0/3
A and B
A= ref $tmp eq "ARRAY"B= $code = $self->can(shift @{$tmp;})
| |||||||||||||||||||||||||||||
| 35 | : undef; | ||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 0 | return; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # pipeline_ex ( [ func1, @args ], [ func2, @args ], ... ) | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub pipeline_ex { | ||||||||||||||||||||||||||
|
Subroutine
pipeline_ex: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 44 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 45 | 0 | my $code; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | map { | ||||||||||||||||||||||||||||
| 48 | 0 | ( ref $_ eq 'ARRAY' && ( $code = $self->can(shift @{ $_ }) ) ) | |||||||||||||||||||||||||||
| 49 | 0 | ▶ | ? $code->($self, @{ $_ }) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $_ eq "ARRAY" and $code = $self->can(shift @{$_;})
MC/DC0%0/2
ref $_ eq "ARRAY" and $code = $self->can(shift @{$_;})
ref $_ eq "ARRAY"
$code = $self->can(shift @{$_;})
Truth table0%0/3
A and B
A= ref $_ eq "ARRAY"B= $code = $self->can(shift @{$_;})
| |||||||||||||||||||||||||||||
| 50 | : undef; | ||||||||||||||||||||||||||||
| 51 | } @_; | ||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 15 | 1; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||