SDK/AppConfiguration/SnapshotFilter.pm

filter: Statementstmt 100% 21 / 21 Branchbran 60.0% 6 / 10 Conditioncond 40.0% 6 / 15 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 66.1% 39 / 59 CC 11 SCAR 26.2
CC
11
Cov
72%
_validate_filter
21.2
__ANON__
2.0
BEGIN
1.0
CRAP 13.7
« SDK/Storage/Tables/ConnectionString.pm ↑ Summary SDK/Storage/Queues/SharedKey.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 class Azure::SDK::AppConfiguration::SnapshotFilter {
6 2 ▶ use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 2 field $key :param :reader;
9 2 field $label :param :reader = undef;
10
11 12 ▶ ADJUST {
Subroutine __ANON__: called CC=2 SCAR=6.9
12 12 _validate_filter('key', $key, 1);
13 12 ▶ _validate_filter('label', $label, 0) if defined $label;
Branch: 1 branch
BranchTrueFalseTotal
if defined $label 8 4 12
14 }
15
16 20 ▶ sub _validate_filter ($name, $value, $required) {
Subroutine _validate_filter: called CC=10 SCAR=30.5
17 20 ▶ croak "App Configuration snapshot filter $name is required"
Branch: 1 branch
BranchTrueFalseTotal
if $required and !defined($value) || ref $value || !length($value) 0 20 20
Condition44%4/9
$required and !defined($value) || ref $value || !length($value)
!ll&&!rl&&r
8120
not defined $value or ref $value or not length $value
l!l&&r!l&&!r
0012
not defined $value or ref $value
l!l&&r!l&&!r
0012
MC/DC0%0/4
$required and !defined($value) || ref $value || !length($value)
$required not defined $value ref $value not length $value
Truth table40%2/5
A and not(B) or C or not(D)
A= $requiredB= not defined $valueC= ref $valueD= not length $value
ABCDresult
0XXX0
10000
11XX1
101X1
10011
18 if $required && (!defined $value || ref $value || !length $value);
19 20 ▶ croak "App Configuration snapshot filter $name must be a non-empty scalar"
Branch: 1 branch
BranchTrueFalseTotal
if not defined $value or ref $value or not length $value 0 20 20
Condition33%2/6
not defined $value or ref $value or not length $value
l!l&&r!l&&!r
0020
not defined $value or ref $value
l!l&&r!l&&!r
0020
MC/DC0%0/3
not defined $value or ref $value or not length $value
not defined $value ref $value not length $value
Truth table25%1/4
not(A) or B or not(C)
A= not defined $valueB= ref $valueC= not length $value
ABCresult
1XX1
01X1
0011
0000
20 if !defined $value || ref $value || !length $value;
21 20 ▶ croak "App Configuration snapshot filter $name contains control characters"
Branch: 1 branch
BranchTrueFalseTotal
if $value =~ /[\x00-\x1f\x7f]/u 0 20 20
22 if $value =~ /[\x00-\x1f\x7f]/;
23 20 ▶ croak "App Configuration snapshot filter $name exceeds 1024 characters"
Branch: 1 branch
BranchTrueFalseTotal
if length $value > 1024 0 20 20
24 if length $value > 1024;
25 }
26 }
27
28 2 1;
29
30 __END__
« SDK/Storage/Tables/ConnectionString.pm ↑ Summary SDK/Storage/Queues/SharedKey.pm »