| 1 | package JSON::Schema::Generator::Handler::Object; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 2 | ▶ | use List::MoreUtils qw(uniq); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | sub process { | ||||||||||
|
Subroutine
process: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||
| 9 | 1 | my ($class, $object_type, $examples, $dispatch) = @_; | |||||||||||
| 10 | 1 | my $examples_by_prop = {}; # HashRef[Str, ArrayRef[Any]] | |||||||||||
| 11 | 1 | for my $data (@$examples) { | |||||||||||
| 12 | 3 | for my $key (keys %$data) { | |||||||||||
| 13 | 13 | ▶ | $examples_by_prop->{$key} //= []; | ||||||||||
|
Condition100%2/2
$examples_by_prop->{$key} //= []
MC/DC100%1/1
$examples_by_prop->{$key} //= []
$examples_by_prop->{$key}
Truth table100%2/2
A
A= $examples_by_prop->{$key}
| |||||||||||||
| 14 | 13 | push @{$examples_by_prop->{$key}}, $data->{$key}; | |||||||||||
| 15 | } | ||||||||||||
| 16 | } | ||||||||||||
| 17 | 1 | my $properties = $object_type->properties; | |||||||||||
| 18 | return { | ||||||||||||
| 19 | type => $object_type->name, | ||||||||||||
| 20 | properties => { | ||||||||||||
| 21 | 1 | map { ($_ => $dispatch->($properties->{$_}, $examples_by_prop->{$_})) } keys %$properties, | |||||||||||
| 22 | }, | ||||||||||||
| 23 | }; | ||||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 2 | 1; | |||||||||||