Generator/Handler/Object.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.4% 27 / 28 CC 4 SCAR 10.0
CC
4
Cov
100%
process
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
↑ Summary Generator.pm »
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} //= []
l!l
85
MC/DC100%1/1
$examples_by_prop->{$key} //= []
$examples_by_prop->{$key}
Truth table100%2/2
A
A= $examples_by_prop->{$key}
Aresult
11
00
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;
↑ Summary Generator.pm »