lib/Rex/Exporter.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 6 / 6 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 92.7% 51 / 55 CC 7 SCAR 15.7
CC
7
Cov
96%
import
7.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.8
« lib/Rex/Cron/Base.pm ↑ Summary lib/Rex/Helper/Hash.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Exporter;
6  
7 105 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 105 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 105 ▶use Symbol;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 105 our $VERSION = '1.16.1'; # VERSION
12  
13 105 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 105 our @EXPORT;
16  
17 3315 ▶sub import {
Subroutine import: called CC=7 SCAR=19.5
18 3315 my ( $mod_to_register, %option ) = @_;
19 3315 my ( $mod_to_register_in, $file, $line ) = caller;
20  
21 3315 ▶ if ( exists $option{register_in} && $option{register_in} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"register_in"} and $option{"register_in"}) 1034 2281 3315
Condition66%2/3
exists $option{"register_in"} and $option{"register_in"}
!ll&&!rl&&r
228101034
MC/DC50%1/2
exists $option{"register_in"} and $option{"register_in"}
exists $option{"register_in"} $option{"register_in"}
Truth table66%2/3
A and B
A= exists $option{"register_in"}B= $option{"register_in"}
ABresult
0X0
100
111
22 1034 $mod_to_register_in = $option{register_in};
23 }
24  
25 3315 my $no_import = "";
26 3315 ▶ if ( exists $option{"-no"} && $option{"-no"} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $option{"-no"} and $option{"-no"}) 12 3303 3315
Condition66%2/3
exists $option{"-no"} and $option{"-no"}
!ll&&!rl&&r
3303012
MC/DC50%1/2
exists $option{"-no"} and $option{"-no"}
exists $option{"-no"} $option{"-no"}
Truth table66%2/3
A and B
A= exists $option{"-no"}B= $option{"-no"}
ABresult
0X0
100
111
27 12 $no_import = "," . join( ",", @{ $option{"-no"} } ) . ",";
28 }
29  
30 3315 my $ref_to_export = qualify_to_ref( 'EXPORT', $mod_to_register );
31 3315 my $ref_to_export_array = *{$ref_to_export}{ARRAY};
32  
33 3315 for my $reg_func ( @{$ref_to_export_array} ) {
34 64976 ▶ if ( $no_import =~ m/,$reg_func,/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($no_import =~ /,$reg_func,/u) 12 64964 64976
35 12 next;
36 }
37  
38 64964 my $ref_to_reg_func_in_source_mod =
39 qualify_to_ref( $reg_func, $mod_to_register );
40 64964 my $ref_to_reg_func_in_target_mod =
41 qualify_to_ref( $reg_func, $mod_to_register_in );
42  
43 64964 *{$ref_to_reg_func_in_target_mod} = *{$ref_to_reg_func_in_source_mod};
44 }
45 }
46  
47 105 1;
« lib/Rex/Cron/Base.pm ↑ Summary lib/Rex/Helper/Hash.pm »