blib/lib/Template/Plugin/Jcode.pm

filter: Statementstmt 94.1% 32 / 34 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 1 / 1 totaltotal 89.8% 44 / 49 CC 3 SCAR 4.7
CC
3
Cov
89%
AUTOLOAD
3.1
_throw
2.0
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package Template::Plugin::Jcode;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base qw(Template::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Template::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Template::Stash;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Jcode;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use vars qw($VERSION $AUTOLOAD);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 $VERSION = '0.02';
10  
11 3 ▶$Template::Stash::SCALAR_OPS->{ jcode } = sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
12 3 my $str = shift;
13 3 return Template::Plugin::Jcode->new($str);
14 2 };
15  
16 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
17 6 my($class, $str) = @_;
18 6 bless { string => $str }, $class;
19 }
20  
21 3 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=3 SCAR=11.2
22 3 my $self = shift;
23 3 my $method = $AUTOLOAD;
24  
25 3 $method =~ s/.*:://;
26 3 ▶ return if $method eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $method eq "DESTROY" 0 3 3
27  
28 3 my $jcode = Jcode->new($self->{string});
29 3 ▶ return $self->_throw("no such Jcode method: $method")
Branch: 1 branch
BranchTrueFalseTotal
unless UNIVERSAL::can($jcode, $method) 0 3 3
30 unless UNIVERSAL::can($jcode, $method);
31 3 return $jcode->$method(@_);
32 }
33  
34 0 ▶sub _throw {
Subroutine _throw: not called CC=1 SCAR=6.9
35 0 my $self = shift;
36 0 die Template::Exception->new('jcode', join(', ', @_));
37 }
38  
39 2 1;
40 __END__
↑ Summary