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/Microdata.pm »
1 package HTML::Lint::Pluggable::WhiteList;
2 2 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.09';
7  
8 2 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub init {
11 10 ▶ my($class, $lint, $conf) = @_;
Subroutine init: called CC=2 SCAR=6.9
Pod undocumented
12  
13 10 ▶ my $rule = $conf->{rule} or croak 'required option: rule';
Branch: 1 branch
BranchTrueFalseTotal
my $rule = $conf->{"rule"} or croak("required option: rule") 0 10 10
14 $lint->override(gripe => sub {
15 10 ▶ my $super = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
16 return sub {
17 37 ▶ my $self = shift;
Subroutine __ANON__: called CC=3 SCAR=11.0
18 37 my $errcode = shift;
19 37 my %errparms = @_;
20  
21 37 ▶ if (my $is_whitelist = $rule->{$errcode}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $is_whitelist = $rule->{$errcode}) 32 5 37
22 32 ▶ return if $is_whitelist->(\%errparms);
Branch: 1 branch
BranchTrueFalseTotal
if &$is_whitelist(\%errparms) 26 6 32
23 }
24  
25 11 $self->$super($errcode, %errparms);
26 10 };
27 10 });
28 }
29  
30 2 1;
31 __END__
« blib/lib/HTML/Lint/Pluggable/HTML5.pm ↑ Summary blib/lib/HTML/Lint/Pluggable/Microdata.pm »