| 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
Condition33%2/6
defined $name and not ref $name and length $name
defined $name and not ref $name
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | unless defined $name && !ref $name && length $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 8 | ▶ | croak 'App Configuration snapshot status is invalid' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $status and not ref $status and $status =~ /\A(?:provisioning|ready|archived|failed)\z/u
defined $status and not ref $status
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Condition33%1/3
@{$filters;} >= 1 and @{$filters;} <= 3
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 8 | for my $filter (@{$filters}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 8 | ▶ | croak 'App Configuration snapshot filter must be a SnapshotFilter' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
builtin::blessed($filter) and $filter->isa("Azure::SDK::AppConfiguration::SnapshotFilter")
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")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
Condition66%2/3
$composition_type eq "key" or $composition_type eq "key_label"
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"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 15 | ▶ | croak "App Configuration snapshot $field->[0] must be a scalar without control characters" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $field->[1] or $field->[1] =~ /[\x00-\x1f\x7f]/u
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 21 | ▶ | croak "App Configuration snapshot $field->[0] must be a non-negative integer" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not ref $field->[1] and $field->[1] =~ /\A[0-9]+\z/u
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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
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
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value or ref $tag_value
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u or not defined $tag_value
not length $tag_name or $tag_name =~ /[\x00-\x1f\x7f]/u
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
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||