blib/lib/HTML5/DOM/CSS/Selector.pm

filter: Statementstmt 54.1% 13 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 2 totaltotal 45.9% 17 / 37 CC 2 SCAR 8.8
CC
2
Cov
50%
array
6.0
__ANON__
2.0
__ANON__
2.0
CRAP 2.4
« blib/lib/HTML5/DOM/Element.pm ↑ Summary blib/lib/HTML5/DOM/AsyncResult.pm »
1 package HTML5::DOM::CSS::Selector;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use HTML5::DOM::CSS::Selector::Entry;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 use overload
8 0 ▶ '""' => sub { shift->text },
Subroutine __ANON__: not called CC=1 SCAR=6.9
9 0 ▶ '@{}' => sub { shift->array },
Subroutine __ANON__: not called CC=1 SCAR=6.9
10 0 ▶ 'bool' => sub { 1 },
Subroutine __ANON__: not called CC=1 SCAR=6.9
11 1 ▶ fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 0 ▶ my ($class, $text) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
15 0 return HTML5::DOM::CSS->new->parseSelector($text);
16 }
17  
18 # TODO: implement in XS?
19 sub array {
20 0 ▶ my $self = shift;
Subroutine array: not called CC=2 SCAR=17.9
Pod undocumented
21 0 my @tmp;
22 0 my $l = $self->length;
23 0 ▶ for (my $i = 0; $i < $l; ++$i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $l) 0 0 0
24 0 push @tmp, $self->entry($i);
25 }
26 0 return \@tmp;
27 }
28  
29 1 1;
30 __END__
« blib/lib/HTML5/DOM/Element.pm ↑ Summary blib/lib/HTML5/DOM/AsyncResult.pm »