Modern/Vocabulary/MetaData.pm

filter: Statementstmt 98.5% 67 / 68 Branchbran 87.5% 7 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 95.8% 23 / 24 Podpod 0.0% 0 / 3 totaltotal 94.1% 97 / 103 CC 5 SCAR 4.3
CC
5
Cov
97%
keywords
4.0
_traverse_keyword_title
2.1
evaluation_order
2.0
CRAP 1.5
« Modern/Vocabulary.pm ↑ Summary Modern/Annotation.pm »
1 38 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 38 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package JSON::Schema::Modern::Vocabulary::MetaData;
4 # vim: set ts=8 sts=2 sw=2 tw=100 et :
5 # ABSTRACT: Implementation of the JSON Schema Meta-Data vocabulary
6  
7 38 our $VERSION = '0.654';
8  
9 38 ▶use 5.020;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 38 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 38 ▶use strictures 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 38 ▶use stable 0.031 'postderef';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 38 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 38 ▶no autovivification warn => qw(fetch store exists delete);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 38 ▶use if "$]" >= 5.022, experimental => 're_strict';
Subroutine BEGIN: called CC=1 SCAR=0.0
16 38 ▶no if "$]" >= 5.031009, feature => 'indirect';
Subroutine BEGIN: called CC=1 SCAR=0.0
17 38 ▶no if "$]" >= 5.033001, feature => 'multidimensional';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 38 ▶no if "$]" >= 5.033006, feature => 'bareword_filehandles';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 38 ▶no if "$]" >= 5.041009, feature => 'smartmatch';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 38 ▶no feature 'switch';
Subroutine BEGIN: called CC=1 SCAR=0.0
21 38 ▶use JSON::Schema::Modern::Utilities qw(assert_keyword_type annotate_self);
Subroutine BEGIN: called CC=1 SCAR=0.0
22 38 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 38 with 'JSON::Schema::Modern::Vocabulary';
25  
26 22 ▶sub vocabulary ($class) {
Subroutine vocabulary: called CC=1 SCAR=0.0
Pod undocumented
27 22 'https://json-schema.org/draft/2019-09/vocab/meta-data' => 'draft2019-09',
28 'https://json-schema.org/draft/2020-12/vocab/meta-data' => 'draft2020-12';
29 }
30  
31 0 ▶sub evaluation_order ($class) { 5 }
Subroutine evaluation_order: not called CC=1 SCAR=6.9
Pod undocumented
32  
33 159 ▶sub keywords ($class, $spec_version) {
Subroutine keywords: called CC=4 SCAR=13.9
Pod undocumented
34 return (
35 159 ▶ qw(title description default),
Branch: 3 branches
BranchTrueFalseTotal
!($spec_version =~ /^draft[467]\z/u) ? : 95 64 159
!($spec_version =~ /^draft[46]\z/u) ? : 126 33 159
$spec_version ne 'draft4' ? : 139 20 159
36 $spec_version !~ /^draft[467]\z/ ? 'deprecated' : (),
37 $spec_version !~ /^draft[46]\z/ ? qw(readOnly writeOnly) : (),
38 $spec_version ne 'draft4' ? 'examples' : (),
39 );
40 }
41  
42 180 ▶sub _traverse_keyword_title ($class, $schema, $state) {
Subroutine _traverse_keyword_title: called CC=2 SCAR=7.2
43 180 ▶ return if not assert_keyword_type($state, $schema, 'string');
Branch: 1 branch
BranchTrueFalseTotal
unless assert_keyword_type($state, $schema, "string") 0 180 180
44 180 return 1;
45 }
46  
47 1109 ▶sub _eval_keyword_title ($class, $data, $schema, $state) {
Subroutine _eval_keyword_title: called CC=1 SCAR=0.0
48 1109 annotate_self($state, $schema);
49 }
50  
51 38 *_traverse_keyword_description = \&_traverse_keyword_title;
52  
53 38 *_eval_keyword_description = \&_eval_keyword_title;
54  
55 275 ▶sub _traverse_keyword_default { 1 }
Subroutine _traverse_keyword_default: called CC=1 SCAR=0.0
56  
57 38 *_eval_keyword_default = \&_eval_keyword_title;
58  
59 20 ▶sub _traverse_keyword_deprecated ($class, $schema, $state) {
Subroutine _traverse_keyword_deprecated: called CC=1 SCAR=0.0
60 20 return assert_keyword_type($state, $schema, 'boolean');
61 }
62  
63 38 *_eval_keyword_deprecated = \&_eval_keyword_title;
64  
65 38 *_traverse_keyword_readOnly = \&_traverse_keyword_deprecated;
66  
67 38 *_eval_keyword_readOnly = \&_eval_keyword_title;
68  
69 38 *_traverse_keyword_writeOnly = \&_traverse_keyword_deprecated;
70  
71 38 *_eval_keyword_writeOnly = \&_eval_keyword_title;
72  
73 13 ▶sub _traverse_keyword_examples ($class, $schema, $state) {
Subroutine _traverse_keyword_examples: called CC=1 SCAR=0.0
74 13 return assert_keyword_type($state, $schema, 'array');
75 }
76  
77 38 *_eval_keyword_examples = \&_eval_keyword_title;
78  
79 38 1;
80  
81 __END__
« Modern/Vocabulary.pm ↑ Summary Modern/Annotation.pm »