Articulate/Augmentation/Interpreter.pm

filter: Statementstmt 46.8% 15 / 32 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 1 totaltotal 42.2% 19 / 45 SCAR 25.8
CC
6
Cov
42%
augment
30.0
__ANON__
6.0
__ANON__
2.0
CRAP 13.1
« Articulate/Service.pm ↑ Summary Articulate/Authentication.pm »
1 package Articulate::Augmentation::Interpreter;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Articulate::Syntax qw(instantiate instantiate_array);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 has default_format =>
9 is => 'rw';
10  
11 has interpreters =>
12 is => 'rw',
13 0 ▶ default => sub { {} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 coerce => sub {
15 0 ▶ my $interpreters = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
16 0 foreach my $type (keys %$interpreters){
17 0 $interpreters->{$type} = instantiate_array( $interpreters->{$type} );
18 }
19 0 return $interpreters;
20 1 };
21  
22 sub augment {
23 0 ▶ my $self = shift;
Subroutine augment: not called CC=5 SCAR=34.0
Pod undocumented
24 0 my $item = shift;
25 0 my $format = $self->default_format;
26 0 foreach my $f ( keys %{ $self->interpreters } ) {
27 0 ▶ if ( ( $item->meta->{schema}->{core}->{format} // '' ) eq $f ) {
Branch: 1 branch
BranchTrueFalseTotal
if (($item->meta->{"schema"}{"core"}{"format"} // "") eq $f) 0 0 0
Condition0%0/2
$item->meta->{"schema"}{"core"}{"format"} // ""
l!l
00
MC/DC0%0/1
$item->meta->{"schema"}{"core"}{"format"} // ""
$item->meta->{"schema"}{"core"}{"format"}
Truth table0%0/2
A
A= $item->meta->{"schema"}{"core"}{"format"}
Aresult
11
00
28 0 $format = $f;
29 0 last;
30 }
31 }
32 0 foreach my $interpreter ( @{ $self->interpreters->{$format} } ) {
33 0 $interpreter->augment($item);
34 }
35 0 return $item;
36 }
37  
38 1 1;
« Articulate/Service.pm ↑ Summary Articulate/Authentication.pm »