| 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 | 4 | ▶ | sub _get_filter { | ||||||||||||||||||
|
Subroutine
_get_filter: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 7 | 4 | my $pkg = shift; | |||||||||||||||||||
| 8 | 4 | ▶ | $pkg = $pkg =~ s/^\+// ? $pkg : "HTML::Shakan::Filter::$pkg"; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 9 | 4 | Mouse::load_class($pkg); | |||||||||||||||||||
| 10 | 4 | return $pkg->new(); | |||||||||||||||||||
| 11 | } | ||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 5 | ▶ | sub filter { | ||||||||||||||||||
|
Subroutine
filter: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||
| 14 | 5 | my ($class, $filter_ary, $val) = @_; | |||||||||||||||||||
| 15 | 5 | ▶ | $filter_ary = [$filter_ary] unless (ref $filter_ary||'') eq 'ARRAY'; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
ref $filter_ary || ''
MC/DC100%1/1
ref $filter_ary || ''
ref $filter_ary
Truth table100%2/2
A
A= ref $filter_ary
| |||||||||||||||||||||
| 16 | 5 | for my $filter (@$filter_ary) { | |||||||||||||||||||
| 17 | 5 | ▶ | unless (blessed $filter) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | 4 | $filter = _get_filter($filter); | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | 5 | $val = $filter->filter($val); | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | 5 | $val; | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 23 | 1; | |||||||||||||||||||
| 26 | __END__ | ||||||||||||||||||||