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 CC 6 SCAR 26.4
CC
6
Cov
42%
augment
30.0
__ANON__
6.0
__ANON__
2.0
CRAP 14.0
« Articulate/Service/SimplePreviews.pm ↑ Summary Articulate/Authentication/Preconfigured.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 => ( is => 'rw', );
9  
10 has interpreters => (
11 is => 'rw',
12 0 ▶ default => sub { {} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
13 0 ▶ coerce => sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
14 0 my $interpreters = shift;
15 0 foreach my $type ( keys %$interpreters ) {
16 0 $interpreters->{$type} = instantiate_array( $interpreters->{$type} );
17 }
18 0 return $interpreters;
19 }
20 1 );
21  
22 0 ▶sub augment {
Subroutine augment: not called CC=5 SCAR=34.0
Pod undocumented
23 0 my $self = shift;
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/SimplePreviews.pm ↑ Summary Articulate/Authentication/Preconfigured.pm »