| 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
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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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 | ||||||||||||||||||||