blib/lib/Valiemon/Attributes/Maximum.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 2 totaltotal 94.5% 35 / 37 CC 3 SCAR 3.4
CC
3
Cov
100%
is_valid
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Valiemon/Attributes/OneOf.pm ↑ Summary blib/lib/Valiemon/Attributes/Not.pm »
1 package Valiemon::Attributes::Maximum;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use parent qw(Valiemon::Attributes);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 22 ▶sub attr_name { 'maximum' }
Subroutine attr_name: called CC=1 SCAR=0.0
Pod undocumented
8  
9 sub is_valid {
10 22 ▶ my ($class, $context, $schema, $data) = @_;
Subroutine is_valid: called CC=2 SCAR=6.9
Pod undocumented
11 22 my $max = $schema->{maximum};
12 22 ▶ my $exclusive = $schema->{exclusiveMaximum} || 0;
Condition100%2/2
$schema->{'exclusiveMaximum'} || 0
l!l
913
MC/DC100%1/1
$schema->{'exclusiveMaximum'} || 0
$schema->{'exclusiveMaximum'}
Truth table100%2/2
A
A= $schema->{'exclusiveMaximum'}
Aresult
11
00
13 $context->in_attr($class, sub {
14 3 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 22 ▶ $exclusive ? $data < $max : $data <= $max;
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
$exclusive ? : 9 13 22
16 22 });
17 }
18  
19 3 1;
« blib/lib/Valiemon/Attributes/OneOf.pm ↑ Summary blib/lib/Valiemon/Attributes/Not.pm »