PurePerl/RNG/rand.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 3 totaltotal 87.5% 28 / 32 SCAR 6.9
CC
2
Cov
96%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« PurePerl/RNG/Bridge.pm ↑ Summary PurePerl/Compat.pm »
1 package UUID::Generator::PurePerl::RNG::rand;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use base qw( UUID::Generator::PurePerl::RNG::Bridge );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶sub enabled { 1 }
Subroutine enabled: called CC=1 SCAR=0.0
Pod undocumented
9  
10 sub new {
11 4 ▶ my $class = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
12 4 my $seed = shift;
13 4 ▶ $seed = time if ! defined $seed;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $seed 4 0 4
14  
15 4 my $me = q{};
16 4 my $self = \$me;
17  
18 4 srand $seed;
19  
20 4 return bless $self, $class;
21 }
22  
23 sub rand_32bit {
24 52 ▶ my $v1 = int(rand(65536)) % 65536;
Subroutine rand_32bit: called CC=1 SCAR=0.0
Pod undocumented
25 52 my $v2 = int(rand(65536)) % 65536;
26 52 return ($v1 << 16) | $v2;
27 }
28  
29 4 1;
30 __END__
« PurePerl/RNG/Bridge.pm ↑ Summary PurePerl/Compat.pm »