PurePerl/RNG.pm

filter: Statementstmt 94.7% 18 / 19 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 2 totaltotal 83.8% 26 / 31 SCAR 16.2
CC
5
Cov
88%
new
4.1
singleton
2.0
BEGIN
1.0
CRAP 5.0
« PurePerl/NodeID.pm ↑ Summary PurePerl/RNG/Bridge.pm »
1 package UUID::Generator::PurePerl::RNG;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 11 my $singleton;
7 sub singleton {
8 1 ▶ my $class = shift;
Subroutine singleton: called CC=2 SCAR=7.0
Pod undocumented
9  
10 1 ▶ if (! defined $singleton) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $singleton) 1 0 1
11 1 $singleton = $class->new(@_);
12 }
13  
14 1 return $singleton;
15 }
16  
17 sub new {
18 3 ▶ shift; # class
Subroutine new: called CC=4 SCAR=14.1
Pod undocumented
19  
20 3 my @classes = qw(
21 UUID::Generator::PurePerl::RNG::MRMT
22 UUID::Generator::PurePerl::RNG::MRMTPP
23 UUID::Generator::PurePerl::RNG::rand
24 );
25  
26 3 foreach my $class (@classes) {
27 9 ▶ next if ! eval qq{ require $class };
Branch: 1 branch
BranchTrueFalseTotal
unless eval " require $class " 0 9 9
28  
29 9 ▶ next if ! $class->enabled;
Branch: 1 branch
BranchTrueFalseTotal
unless $class->enabled 6 3 9
30  
31 3 return $class->new();
32 }
33  
34 0 return;
35 }
36  
37 11 1;
38 __END__
« PurePerl/NodeID.pm ↑ Summary PurePerl/RNG/Bridge.pm »