SDK/AppConfiguration/ConfigurationSnapshot.pm

filter: Statementstmt 93.3% 56 / 60 Branchbran 58.3% 14 / 24 Conditioncond 35.9% 14 / 39 MC/DCmcdc 0.0% 0 / 21 Subroutinesub 77.7% 7 / 9 Podpod 100% 2 / 2 totaltotal 60.0% 93 / 155 CC 30 SCAR 42.1
CC
30
Cov
68%
__ANON__
84.7
filters
2.0
tags
2.0
CRAP 67.2
↑ Summary SDK/Storage/Tables/EntityProperty.pm »
1 2 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use feature 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶no warnings 'experimental::class';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 2 ▶use Azure::SDK::AppConfiguration::SnapshotFilter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 2 class Azure::SDK::AppConfiguration::ConfigurationSnapshot {
8 2 ▶ use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶ use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 2 field $name :param :reader;
12 2 field $status :param :reader;
13 2 field $filters :param;
14 2 field $composition_type :param :reader = 'key';
15 2 field $created :param :reader = undef;
16 2 field $expires :param :reader = undef;
17 2 field $retention_period :param :reader = undef;
18 2 field $size :param :reader = undef;
19 2 field $items_count :param :reader = undef;
20 2 field $tags :param = {};
21 2 field $etag :param :reader;
22
23 8 ▶ ADJUST {
Subroutine __ANON__: called CC=30 SCAR=44.4
24 8 ▶ croak 'App Configuration snapshot name must be a non-empty scalar'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name and not ref $name and length $name 0 8 8
Condition33%2/6
defined $name and not ref $name and length $name
!ll&&!rl&&r
008
defined $name and not ref $name
!ll&&!rl&&r
008
MC/DC0%0/3
defined $name and not ref $name and length $name
defined $name not ref $name length $name
Truth table25%1/4
A and not(B) and C
A= defined $nameB= not ref $nameC= length $name
ABCresult
0XX0
10X0
1100
1111
25 unless defined $name && !ref $name && length $name;
26 8 ▶ croak 'App Configuration snapshot status is invalid'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $status and not ref $status and $status =~ /\A(?:provisioning|ready|archived|failed)\z/u 0 8 8
Condition33%2/6
defined $status and not ref $status and $status =~ /\A(?:provisioning|ready|archived|failed)\z/u
!ll&&!rl&&r
008
defined $status and not ref $status
!ll&&!rl&&r
008
MC/DC0%0/3
defined $status and not ref $status and $status =~ /\A(?:provisioning|ready|archived|failed)\z/u
defined $status not ref $status $status =~ /\A(?:provisioning|ready|archived|failed)\z/u
Truth table25%1/4
A and not(B) and C
A= defined $statusB= not ref $statusC= $status =~ /\A(?:provisioning|ready|archived|failed)\z/u
ABCresult
0XX0
10X0
1100
1111
27 unless defined $status && !ref $status
28 && $status =~ /\A(?:provisioning|ready|archived|failed)\z/;
29 8 ▶ croak 'App Configuration snapshot filters must be an array reference'
Branch: 1 branch
BranchTrueFalseTotal
unless ref $filters eq "ARRAY" 0 8 8
30 unless ref $filters eq 'ARRAY';
31 croak 'App Configuration snapshot must contain one to three filters'
32 8 ▶ unless @{$filters} >= 1 && @{$filters} <= 3;
Branch: 1 branch
BranchTrueFalseTotal
unless @{$filters;} >= 1 and @{$filters;} <= 3 0 8 8
Condition33%1/3
@{$filters;} >= 1 and @{$filters;} <= 3
!ll&&!rl&&r
008
MC/DC0%0/2
@{$filters;} >= 1 and @{$filters;} <= 3
@{$filters;} >= 1 @{$filters;} <= 3
Truth table33%1/3
A and B
A= @{$filters;} >= 1B= @{$filters;} <= 3
ABresult
0X0
100
111
33 8 for my $filter (@{$filters}) {
34 8 ▶ croak 'App Configuration snapshot filter must be a SnapshotFilter'
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($filter) and $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter") 0 8 8
Condition33%1/3
builtin::blessed($filter) and $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter")
!ll&&!rl&&r
008
MC/DC0%0/2
builtin::blessed($filter) and $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter")
builtin::blessed($filter) $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter")
Truth table33%1/3
A and B
A= builtin::blessed($filter)B= $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter")
ABresult
0X0
100
111
35 unless blessed($filter)
36 && $filter->isa('Azure::SDK::AppConfiguration::SnapshotFilter');
37 }
38 8 $filters = [@{$filters}];
39
40 8 ▶ croak 'App Configuration snapshot composition_type is invalid'
Branch: 1 branch
BranchTrueFalseTotal
unless $composition_type eq "key" or $composition_type eq "key_label" 0 8 8
Condition66%2/3
$composition_type eq "key" or $composition_type eq "key_label"
l!l&&r!l&&!r
170
MC/DC0%0/2
$composition_type eq "key" or $composition_type eq "key_label"
$composition_type eq "key" $composition_type eq "key_label"
Truth table66%2/3
A or B
A= $composition_type eq "key"B= $composition_type eq "key_label"
ABresult
1X1
011
000
41 unless $composition_type eq 'key' || $composition_type eq 'key_label';
42 8 for my $field (
43 ['created', $created],
44 ['expires', $expires],
45 ['etag', $etag],
46 ) {
47 24 ▶ next unless defined $field->[1];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $field->[1] 9 15 24
48 15 ▶ croak "App Configuration snapshot $field->[0] must be a scalar without control characters"
Branch: 1 branch
BranchTrueFalseTotal
if ref $field->[1] or $field->[1] =~ /[\x00-\x1f\x7f]/u 0 15 15
Condition33%1/3
ref $field->[1] or $field->[1] =~ /[\x00-\x1f\x7f]/u
l!l&&r!l&&!r
0015
MC/DC0%0/2
ref $field->[1] or $field->[1] =~ /[\x00-\x1f\x7f]/u
ref $field->[1] $field->[1] =~ /[\x00-\x1f\x7f]/u
Truth table33%1/3
A or B
A= ref $field->[1]B= $field->[1] =~ /[\x00-\x1f\x7f]/u
ABresult
1X1
011
000
49 if ref($field->[1]) || $field->[1] =~ /[\x00-\x1f\x7f]/;
50 }
51 8 for my $field (
52 ['retention_period', $retention_period],
53 ['size', $size],
54 ['items_count', $items_count],
55 ) {
56 24 ▶ next unless defined $field->[1];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $field->[1] 3 21 24
57 21 ▶ croak "App Configuration snapshot $field->[0] must be a non-negative integer"
Branch: 1 branch
BranchTrueFalseTotal
unless not ref $field->[1] and $field->[1] =~ /\A[0-9]+\z/u 0 21 21
Condition33%1/3
not ref $field->[1] and $field->[1] =~ /\A[0-9]+\z/u
!ll&&!rl&&r
0021
MC/DC0%0/2
not ref $field->[1] and $field->[1] =~ /\A[0-9]+\z/u
not ref $field->[1] $field->[1] =~ /\A[0-9]+\z/u
Truth table33%1/3
not(A) and B
A= not ref $field->[1]B= $field->[1] =~ /\A[0-9]+\z/u
ABresult
0X0
100
111
58 unless !ref($field->[1]) && $field->[1] =~ /\A[0-9]+\z/;
59 }
60 8 ▶ croak 'App Configuration snapshot tags must be a hash reference'
Branch: 1 branch
BranchTrueFalseTotal
unless ref $tags eq "HASH" 0 8 8
61 unless ref $tags eq 'HASH';
62 8 my %copy;
63 8 for my $tag_name (keys %{$tags}) {
64 7 my $tag_value = $tags->{$tag_name};
65 7 ▶ croak 'App Configuration snapshot tag must use scalar name and value'
Branch: 1 branch
BranchTrueFalseTotal
if not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value or ref $tag_value or $tag_value =~ /[\x00-\x1f\x7f]/u 0 7 7
Condition33%4/12
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value or ref $tag_value or $tag_value =~ /[\x00-\x1f\x7f]/u
l!l&&r!l&&!r
007
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value or ref $tag_value
l!l&&r!l&&!r
007
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value
l!l&&r!l&&!r
007
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u
l!l&&r!l&&!r
007
MC/DC0%0/5
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value or ref $tag_value or $tag_value =~ /[\x00-\x1f\x7f]/u
not length $tag_name $tag_name =~ /[\x00-\x1f\x7f]/u not defined $tag_value ref $tag_value $tag_value =~ /[\x00-\x1f\x7f]/u
Truth table16%1/6
not(A) or B or not(C) or D or E
A= not length $tag_nameB= $tag_name =~ /[\x00-\x1f\x7f]/uC= not defined $tag_valueD= ref $tag_valueE= $tag_value =~ /[\x00-\x1f\x7f]/u
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
66 if !length($tag_name) || $tag_name =~ /[\x00-\x1f\x7f]/
67 || !defined($tag_value) || ref($tag_value)
68 || $tag_value =~ /[\x00-\x1f\x7f]/;
69 7 $copy{$tag_name} = "$tag_value";
70 }
71 8 $tags = \%copy;
72 }
73
74 0 ▶ method filters () { return [@{$filters}]; }
Subroutine filters: not called CC=1 SCAR=6.9
Pod documented
75 0 ▶ method tags () { return {%{$tags}}; }
Subroutine tags: not called CC=1 SCAR=6.9
Pod documented
76 }
77
78 2 1;
79
80 __END__
↑ Summary SDK/Storage/Tables/EntityProperty.pm »