JSV/Keyword/Draft4/MaxProperties.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/MaxLength.pm ↑ Summary JSV/Keyword/Draft4/MinItems.pm »
1 package JSV::Keyword::Draft4::MaxProperties;
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 47 ▶use JSV::Keyword qw(:constants);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub instance_type() { INSTANCE_TYPE_OBJECT(); }
9 sub keyword() { "maxProperties" }
10 sub keyword_priority() { 10; }
11  
12 16 ▶sub validate {
Subroutine validate: called CC=2 SCAR=6.9
Pod undocumented
13 16 my ($class, $context, $schema, $instance) = @_;
14  
15 16 my $keyword_value = $class->keyword_value($schema);
16  
17 16 ▶ if (scalar keys %$instance > $keyword_value) {
Branch: 1 branch
BranchTrueFalseTotal
if (scalar keys %$instance > $keyword_value) 4 12 16
18 4 $context->log_error("The instance properties is greater than maxProperties value");
19 }
20 }
21  
22 47 1;
« JSV/Keyword/Draft4/MaxLength.pm ↑ Summary JSV/Keyword/Draft4/MinItems.pm »