blib/lib/HTML5/DOM/Node.pm

filter: Statementstmt 73.6% 53 / 72 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.7% 17 / 28 Podpod n/a totaltotal 65.4% 70 / 107 CC 3 SCAR 6.8
CC
3
Cov
69%
__ANON__
6.0
__ANON__
6.0
__ANON__
2.0
CRAP 2.0
« blib/lib/HTML5/leaks.pl ↑ Summary blib/lib/HTML5/DOM/CSS/Selector/Entry.pm »
1 package HTML5::DOM::Node;
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 use overload
6 0 ▶ '""' => sub { $_[0]->html },
Subroutine __ANON__: not called CC=1 SCAR=6.9
7 0 ▶ '@{}' => sub { $_[0]->childrenNode->array },
Subroutine __ANON__: not called CC=1 SCAR=6.9
8 '%{}' => \&__attrHashAccess,
9 0 ▶ '==' => sub { defined $_[1] && $_[0]->isSameNode($_[1]) },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
defined $_[1] and $_[0]->isSameNode($_[1]) 0 0 0
10 0 ▶ '!=' => sub { !defined $_[1] || !$_[0]->isSameNode($_[1]) },
Subroutine __ANON__: not called CC=2 SCAR=17.9
Condition0%0/3
defined $_[1] && $_[0]->isSameNode($_[1])
!ll&&!rl&&r
000
MC/DC0%0/2
defined $_[1] && $_[0]->isSameNode($_[1])
defined $_[1] $_[0]->isSameNode($_[1])
Truth table0%0/3
A && B
A= defined $_[1]B= $_[0]->isSameNode($_[1])
ABresult
0X0
100
111
11 0 ▶ 'bool' => sub { 1 },
Subroutine __ANON__: not called CC=1 SCAR=6.9
12 1 ▶ fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 # https://developer.mozilla.org/pl/docs/Web/API/Element/nodeType
15 1 ▶use constant ELEMENT_NODE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use constant ATTRIBUTE_NODE => 2; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use constant TEXT_NODE => 3;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use constant CDATA_SECTION_NODE => 4; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use constant ENTITY_REFERENCE_NODE => 5; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use constant ENTITY_NODE => 6; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use constant PROCESSING_INSTRUCTION_NODE => 7; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use constant COMMENT_NODE => 8;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 ▶use constant DOCUMENT_NODE => 9;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use constant DOCUMENT_TYPE_NODE => 10;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use constant DOCUMENT_FRAGMENT_NODE => 11;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use constant NOTATION_NODE => 12; # not supported
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 sub __attrHashAccess {
29 0 ▶ my $self = shift;
Subroutine __attrHashAccess: not called CC=1 SCAR=6.9
30 0 my %h;
31 0 tie %h, 'HTML5::DOM::Node::_AttrHashAccess', $self;
32 0 return \%h;
33 }
34  
35 1 1;
36  
37 package HTML5::DOM::Node::_AttrHashAccess;
38 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41 sub TIEHASH {
42 0 ▶ my $p = shift;
Subroutine TIEHASH: not called CC=1 SCAR=6.9
43 0 bless \shift, $p
44 }
45  
46 sub EXISTS {
47 0 ▶ defined ${shift()}->attr(shift);
Subroutine EXISTS: not called CC=1 SCAR=6.9
48 }
49  
50 sub DELETE {
51 0 ▶ ${shift()}->removeAttr(shift);
Subroutine DELETE: not called CC=1 SCAR=6.9
52 }
53  
54 sub FETCH {
55 0 ▶ ${shift()}->attr(shift);
Subroutine FETCH: not called CC=1 SCAR=6.9
56 }
57  
58 sub STORE {
59 0 ▶ ${shift()}->attr(shift, shift);
Subroutine STORE: not called CC=1 SCAR=6.9
60 }
61  
62 1 1;
« blib/lib/HTML5/leaks.pl ↑ Summary blib/lib/HTML5/DOM/CSS/Selector/Entry.pm »