Object/InsideOut/Secure.pm

filter: Statementstmt 100% 29 / 29 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 88.6% 39 / 44 CC 3 SCAR 4.1
CC
3
Cov
91%
BEGIN
2.5
_id
2.0
BEGIN
1.0
CRAP 1.5
« Bundle/Object/InsideOut.pm ↑ Summary
1 package Object::InsideOut::Secure; {
2 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶ use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '4.05';
7 1 $VERSION = eval $VERSION;
8  
9 1 ▶ use Object::InsideOut 4.05 ':hash_only';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # Holds used IDs
12 1 my %used :Field = ( 0 => undef );
13  
14 # Our PRNG
15 1 ▶ BEGIN {
Subroutine BEGIN: called CC=2 SCAR=9.2
16 $Math::Random::MT::Auto::shared = ($Config::Config{useithreads} &&
17 1 ▶ $threads::shared::threads_shared);
Condition33%1/3
$Config::Config{'useithreads'} && $threads::shared::threads_shared
!ll&&!rl&&r
100
MC/DC0%0/2
$Config::Config{'useithreads'} && $threads::shared::threads_shared
$Config::Config{'useithreads'} $threads::shared::threads_shared
Truth table33%1/3
A && B
A= $Config::Config{'useithreads'}B= $threads::shared::threads_shared
ABresult
0X0
100
111
18 }
19 1 ▶ use Math::Random::MT::Auto 5.04 ':!auto';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 my $prng = Math::Random::MT::Auto->new();
21  
22 # Assigns random IDs
23 1 ▶ sub _id :ID
Subroutine _id: called CC=2 SCAR=7.0
24 {
25 1 my $id;
26 1 ▶ while (exists($used{$id = $prng->irand()})) {}
Branch: 1 branch
BranchTrueFalseTotal
if (exists $used{$id = $prng->irand}) 0 1 1
27 1 $used{$id} = undef;
28 1 return $id;
29 1 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.0
30 }
31  
32 1 1;
33  
34 # EOF
« Bundle/Object/InsideOut.pm ↑ Summary