JSV/Keyword/Draft4/MaxItems.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.0% 24 / 25 CC 2 SCAR 2.9
CC
2
Cov
100%
validate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« JSV/Keyword/Draft4/Ref.pm ↑ Summary JSV/Keyword/Draft4/MaxLength.pm »
1 package JSV::Keyword::Draft4::MaxItems;
2  
3 47 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 47 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 47 ▶use parent qw(JSV::Keyword);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 47 ▶use JSV::Keyword qw(:constants);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub instance_type() { INSTANCE_TYPE_ARRAY(); }
10 sub keyword() { "maxItems" }
11 sub keyword_priority() { 10; }
12  
13 22 ▶sub validate {
Subroutine validate: called CC=2 SCAR=6.9
Pod undocumented
14 22 my ($class, $context, $schema, $instance) = @_;
15  
16 22 my $keyword_value = $class->keyword_value($schema);
17  
18 22 ▶ if (scalar(@$instance) > $keyword_value) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$instance > $keyword_value) 6 16 22
19 6 $context->log_error("The instance array length is greater than maxItems value");
20 }
21 }
22  
23 47 1;
« JSV/Keyword/Draft4/Ref.pm ↑ Summary JSV/Keyword/Draft4/MaxLength.pm »