Handlebars/Helpers.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond 75.0% 3 / 4 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 89.1% 33 / 37 CC 3 SCAR 4.1
CC
3
Cov
96%
HANDLEBARS_HELPERS
2.0
Helper
2.0
BEGIN
1.0
CRAP 1.5
« Handlebars.pm ↑ Summary
1 package Dancer2::Template::Handlebars::Helpers 1.00;
2  
3 # ABSTRACT: parent class for Handlebars' helper collections
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Sub::Attribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 my %HELPERS;
11  
12 1 ▶sub HANDLEBARS_HELPERS {
Subroutine HANDLEBARS_HELPERS: called CC=2 SCAR=7.1
Pod undocumented
13 1 my $class = shift;
14 1 ▶ %{ $HELPERS{$class} || {} };
Condition50%1/2
$HELPERS{$class} || {}
l!l
10
MC/DC0%0/1
$HELPERS{$class} || {}
$HELPERS{$class}
Truth table50%1/2
A
A= $HELPERS{$class}
Aresult
11
00
15 }
16  
17 2 ▶sub Helper : ATTR_SUB {
Subroutine Helper: called CC=2 SCAR=6.9
Pod undocumented
18 2 my ( $class, $sym_ref, undef, undef, $attr_data ) = @_;
19  
20 2 my $fname = $class . '::' . *{$sym_ref}{NAME};
21 2 ▶ my $helper_name = $attr_data || *{$sym_ref}{NAME};
Condition100%2/2
$attr_data || *{$sym_ref;}{'NAME'}
l!l
11
MC/DC100%1/1
$attr_data || *{$sym_ref;}{'NAME'}
$attr_data
Truth table100%2/2
A
A= $attr_data
Aresult
11
00
22  
23 2 $HELPERS{$class}{$helper_name} = \&$fname;
24 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 1;
27  
28 __END__
« Handlebars.pm ↑ Summary