GrowthBook/Experiment.pm

filter: Statementstmt 82.1% 92 / 112 Branchbran 22.7% 5 / 22 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 81.2% 26 / 32 Podpod 0.0% 0 / 28 totaltotal 63.9% 126 / 197 CC 13 SCAR 23.9
CC
13
Cov
73%
update
56.0
to_hash
7.9
name
1.3
CRAP 10.9
« GrowthBook/Eval.pm ↑ Summary GrowthBook/Util.pm »
1 package WebService::GrowthBook::Experiment;
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 4 ▶use WebService::GrowthBook::Util qw(adjust_args_camel_to_snake);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.003'; ## VERSION
9  
10 class WebService::GrowthBook::Experiment {
11 551 ▶ field $key :param :reader;
Subroutine key: called CC=1 SCAR=0.0
Pod undocumented
12 362 field $variations :param :reader //= [];
13 362 ▶ field $weights :param :reader //= [];
Subroutine variations: called CC=1 SCAR=0.0
Pod undocumented
14 58 ▶ field $active :param :reader //= 1;
Subroutine weights: called CC=1 SCAR=0.0
Pod undocumented
15 75 ▶ field $status :param :reader //= "running";
Subroutine active: called CC=1 SCAR=0.0
Pod undocumented
16 128 ▶ field $coverage :param :reader //= undef;
Subroutine status: called CC=1 SCAR=0.0
Pod undocumented
17 65 ▶ field $condition :param :reader //= undef;
Subroutine coverage: called CC=1 SCAR=0.0
Pod undocumented
18 68 ▶ field $namespace :param :reader //= undef;
Subroutine condition: called CC=1 SCAR=0.0
Pod undocumented
19 68 ▶ field $url :param :reader //= '';
Subroutine namespace: called CC=1 SCAR=0.0
Pod undocumented
20 65 ▶ field $include :param :reader //= undef;
Subroutine url: called CC=1 SCAR=0.0
Pod undocumented
21 66 ▶ field $groups :param :reader //= undef;
Subroutine include: called CC=1 SCAR=0.0
Pod undocumented
22 65 ▶ field $force :param :reader //= undef;
Subroutine groups: called CC=1 SCAR=0.0
Pod undocumented
23 63 ▶ field $hash_attribute :param :reader //= 'id';
Subroutine force: called CC=1 SCAR=0.0
Pod undocumented
24 156 ▶ field $fallback_attribute :param :reader //= undef;
Subroutine hash_attribute: called CC=1 SCAR=0.0
Pod undocumented
25 156 ▶ field $hash_version :param :reader //= 1;
Subroutine fallback_attribute: called CC=1 SCAR=0.0
Pod undocumented
26 65 ▶ field $ranges :param :reader //= undef;
Subroutine hash_version: called CC=1 SCAR=0.0
Pod undocumented
27 65 ▶ field $meta :param :reader //= undef;
Subroutine ranges: called CC=1 SCAR=0.0
Pod undocumented
28 85 ▶ field $filters :param :reader //= undef;
Subroutine meta: called CC=1 SCAR=0.0
Pod undocumented
29 73 ▶ field $seed :param :reader //= undef;
Subroutine filters: called CC=1 SCAR=0.0
Pod undocumented
30 65 ▶ field $name :param :reader //= undef;
Subroutine seed: called CC=1 SCAR=0.0
Pod undocumented
31 0 ▶ field $phase :param :reader //= undef;;
Subroutine name: not called CC=1 SCAR=2.6
Subroutine phase: not called CC=1 SCAR=2.6
Pod undocumented
Pod undocumented
32 0 field $disable_sticky_bucketing :param :reader //= 0;
33 0 ▶ field $bucket_version :param :reader //= 0;
Subroutine disable_sticky_bucketing: not called CC=1 SCAR=2.6
Pod undocumented
34 0 ▶ field $min_bucket_version :param :reader //= 0;
Subroutine bucket_version: not called CC=1 SCAR=2.6
Pod undocumented
35 0 ▶ field $parent_conditions :param :reader //= undef;
Subroutine min_bucket_version: not called CC=1 SCAR=1.2
Pod undocumented
36  
37 65 ▶ sub BUILDARGS {
Subroutine BUILDARGS: called CC=1 SCAR=0.0
Subroutine parent_conditions: called CC=1 SCAR=0.0
Pod undocumented
Pod undocumented
38 90 my ($class, %args) = @_;
39 90 adjust_args_camel_to_snake(\%args);
40 90 return %args;
41 }
42  
43  
44 0 ▶ method update($data) {
Subroutine update: not called CC=7 SCAR=40.3
Pod undocumented
45 0 ▶ $weights = $data->{weights} if exists $data->{weights};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"weights"} 0 0 0
46 0 ▶ $status = $data->{status} if exists $data->{status};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"status"} 0 0 0
47 0 ▶ $coverage = $data->{coverage} if exists $data->{coverage};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"coverage"} 0 0 0
48 0 ▶ $url = $data->{url} if exists $data->{url};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"url"} 0 0 0
49 0 ▶ $groups = $data->{groups} if exists $data->{groups};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"groups"} 0 0 0
50 0 ▶ $force = $data->{force} if exists $data->{force};
Branch: 1 branch
BranchTrueFalseTotal
if exists $data->{"force"} 0 0 0
51 4 }
52  
53 16 ▶ method to_hash {
Subroutine to_hash: called CC=7 SCAR=20.7
Pod undocumented
54 16 ▶ my %obj = (
Condition100%2/2
$coverage // 1
l!l
214
MC/DC100%1/1
$coverage // 1
$coverage
Truth table100%2/2
A
A= $coverage
Aresult
11
00
55 key => $key,
56 variations => $variations,
57 weights => $weights,
58 active => $active,
59 coverage => $coverage // 1,
60 condition => $condition,
61 namespace => $namespace,
62 force => $force,
63 hash_attribute => $hash_attribute,
64 hash_version => $hash_version,
65 ranges => $ranges,
66 meta => $meta,
67 filters => $filters,
68 seed => $seed,
69 name => $name,
70 phase => $phase,
71 );
72  
73 16 ▶ $obj{fallback_attribute} = $fallback_attribute if defined $fallback_attribute;
Branch: 1 branch
BranchTrueFalseTotal
if defined $fallback_attribute 0 16 16
74 16 ▶ $obj{disable_sticky_bucketing} = 1 if $disable_sticky_bucketing;
Branch: 1 branch
BranchTrueFalseTotal
if $disable_sticky_bucketing 0 16 16
75 16 ▶ $obj{bucket_version} = bucket_version if $bucket_version;
Branch: 1 branch
BranchTrueFalseTotal
if $bucket_version 0 16 16
76 16 ▶ $obj{min_bucket_version} = min_bucket_version if $min_bucket_version;
Branch: 1 branch
BranchTrueFalseTotal
if $min_bucket_version 0 16 16
77 16 ▶ $obj{parent_conditions} = parent_conditions if $parent_conditions;
Branch: 1 branch
BranchTrueFalseTotal
if $parent_conditions 0 16 16
78  
79 16 return \%obj;
80 4 }
81 }
82  
83 4 1;
« GrowthBook/Eval.pm ↑ Summary GrowthBook/Util.pm »