lib/Perl/ToPerl6/Utils/DataConversion.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 95.2% 40 / 42 CC 5 SCAR 5.9
CC
5
Cov
93%
dor
3.1
defined_or_empty
2.1
boolean_to_number
2.0
CRAP 1.8
« lib/Perl/ToPerl6/Transformer/Packages/RewriteDeclarations.pm ↑ Summary lib/Perl/ToPerl6/Transformer/Packages/RewriteUsages.pm »
1 package Perl::ToPerl6::Utils::DataConversion;
2  
3 25 ▶use 5.006001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 25 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 25 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 25 ▶use Perl::ToPerl6::Utils qw{ :characters :booleans };
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 25 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #-----------------------------------------------------------------------------
13  
14 25 Readonly::Array our @EXPORT_OK => qw(
15 boolean_to_number
16 dor
17 defined_or_empty
18 );
19  
20 #-----------------------------------------------------------------------------
21  
22 284 ▶sub boolean_to_number {
Subroutine boolean_to_number: called CC=2 SCAR=6.9
Pod documented
23 284 ▶ return $_[0] ? $TRUE : $FALSE;
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 3 281 284
24 }
25  
26 #-----------------------------------------------------------------------------
27  
28 3156 ▶sub dor {
Subroutine dor: called CC=3 SCAR=11.2
Pod documented
29 3156 foreach (@_) {
30 8094 ▶ return $_ if defined;
Branch: 1 branch
BranchTrueFalseTotal
if defined $_ 3156 4938 8094
31 }
32 0 return;
33 }
34  
35 #-----------------------------------------------------------------------------
36  
37 5 ▶sub defined_or_empty {
Subroutine defined_or_empty: called CC=2 SCAR=7.6
Pod documented
38 5 ▶ return defined $_[0] ? $_[0] : $EMPTY;
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] ? : 5 0 5
39 }
40  
41 #-----------------------------------------------------------------------------
42  
43 25 1;
44  
45 __END__
« lib/Perl/ToPerl6/Transformer/Packages/RewriteDeclarations.pm ↑ Summary lib/Perl/ToPerl6/Transformer/Packages/RewriteUsages.pm »