blib/lib/HTML/Lint/Pluggable/WhiteList.pm

filter: Statementstmt 100% 24 / 24 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 94.7% 36 / 38 SCAR 13.9
CC
4
Cov
97%
__ANON__
3.0
init
2.0
BEGIN
1.0
CRAP 4.0
« blib/lib/HTML/Lint/Pluggable/HTML5.pm ↑ Summary blib/lib/HTML/Lint/Pluggable/TinyEntitesEscapeRule.pm »
1 package HTML::Lint::Pluggable::WhiteList;
2 1 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.08';
7  
8 1 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub init {
11 5 ▶ my($class, $lint, $conf) = @_;
Subroutine init: called CC=2 SCAR=6.9
Pod undocumented
12  
13 5 ▶ my $rule = $conf->{rule} or croak 'required option: rule';
Branch: 1 branch
BranchTrueFalseTotal
my $rule = $conf->{"rule"} or croak("required option: rule") 0 5 5
14 $lint->override(gripe => sub {
15 5 ▶ my $super = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
16 return sub {
17 26 ▶ my $self = shift;
Subroutine __ANON__: called CC=3 SCAR=11.0
18 26 my $errcode = shift;
19 26 my %errparms = @_;
20  
21 26 ▶ if (my $is_whitelist = $rule->{$errcode}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $is_whitelist = $rule->{$errcode}) 21 5 26
22 21 ▶ return if $is_whitelist->(\%errparms);
Branch: 1 branch
BranchTrueFalseTotal
if &$is_whitelist(\%errparms) 17 4 21
23 }
24  
25 9 $self->$super($errcode, %errparms);
26 5 };
27 5 });
28 }
29  
30 1 1;
31 __END__
« blib/lib/HTML/Lint/Pluggable/HTML5.pm ↑ Summary blib/lib/HTML/Lint/Pluggable/TinyEntitesEscapeRule.pm »