blib/lib/HTML/Shakan/Filters.pm

filter: Statementstmt 100% 21 / 21 Branchbran 83.3% 5 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 94.4% 34 / 36 CC 6 SCAR 11.6
CC
6
Cov
97%
filter
5.0
_get_filter
2.0
BEGIN
1.0
CRAP 3.2
« blib/lib/HTML/Shakan/Widgets/Simple.pm ↑ Summary blib/lib/HTML/Shakan/Renderer/HTML.pm »
1 package HTML::Shakan::Filters;
2 23 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 23 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 23 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub _get_filter {
7 7 ▶ my $pkg = shift;
Subroutine _get_filter: called CC=2 SCAR=7.0
8 7 ▶ $pkg = $pkg =~ s/^\+// ? $pkg : "HTML::Shakan::Filter::$pkg";
Branch: 1 branch
BranchTrueFalseTotal
$pkg =~ s/^\+// ? : 0 7 7
9 7 Mouse::load_class($pkg);
10 7 return $pkg->new();
11 }
12  
13 sub filter {
14 49 ▶ my ($class, $filter_ary, $val) = @_;
Subroutine filter: called CC=5 SCAR=16.1
Pod undocumented
15 49 ▶ $filter_ary = [$filter_ary] unless (ref $filter_ary||'') eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $filter_ary || "") eq "ARRAY" 5 44 49
Condition100%2/2
ref $filter_ary || ''
l!l
454
MC/DC100%1/1
ref $filter_ary || ''
ref $filter_ary
Truth table100%2/2
A
A= ref $filter_ary
Aresult
11
00
16 49 for my $filter (@$filter_ary) {
17 8 ▶ unless (blessed $filter) {
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($filter)) 7 1 8
18 7 $filter = _get_filter($filter);
19 }
20 8 $val = $filter->filter($val);
21 }
22 49 $val;
23 }
24  
25 23 1;
26 __END__
27  
28 =head1 NAME
29  
30 HTML::Shakan::Filters - filter class manager
31  
32 =head1 DESCRIPTION
33  
34 INTERNAL USE ONLY
35  
36 =head1 SEE ALSO
37  
38 L<HTML::Shakan>
39  
« blib/lib/HTML/Shakan/Widgets/Simple.pm ↑ Summary blib/lib/HTML/Shakan/Renderer/HTML.pm »