blib/lib/Template/Plugin/FillInForm.pm

filter: Statementstmt 100% 32 / 32 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 50.0% 1 / 2 totaltotal 88.0% 44 / 50 CC 3 SCAR 3.2
CC
3
Cov
92%
new
2.1
__ANON__
2.0
filter_factory
1.0
CRAP 1.4
↑ Summary
1 package Template::Plugin::FillInForm;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 $VERSION = 0.04;
6  
7 2 require Template::Plugin;
8 2 ▶use base qw(Template::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use vars qw($FILTER_NAME);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 $FILTER_NAME = 'fillinform';
12  
13 2 ▶use HTML::FillInForm;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
Pod documented
16 2 my($class, $context, @args) = @_;
17 2 ▶ my $name = $args[0] || $FILTER_NAME;
Condition33%1/3
$args[0] || $Template::Plugin::FillInForm::FILTER_NAME
l!l&&r!l&&!r
020
MC/DC0%0/2
$args[0] || $Template::Plugin::FillInForm::FILTER_NAME
$args[0] $Template::Plugin::FillInForm::FILTER_NAME
Truth table33%1/3
A || B
A= $args[0]B= $Template::Plugin::FillInForm::FILTER_NAME
ABresult
1X1
011
000
18 2 $context->define_filter($name, $class->filter_factory());
19 2 bless {}, $class;
20 }
21  
22 2 ▶sub filter_factory {
Subroutine filter_factory: called CC=1 SCAR=0.0
Pod undocumented
23 2 my $class = shift;
24 2 ▶ my $sub = sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
25 2 my($context, @args) = @_;
26 2 ▶ my $config = ref $args[-1] eq 'HASH' ? pop(@args) : { };
Branch: 1 branch
BranchTrueFalseTotal
ref $args[-1] eq 'HASH' ? : 2 0 2
27 2 ▶ return sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
28 2 my $text = shift;
29 2 my $fif = HTML::FillInForm->new;
30 2 return $fif->fill(scalarref => \$text, %$config);
31 2 };
32 2 };
33 2 return [ $sub, 1 ];
34 }
35  
36 2 1;
37 __END__
↑ Summary