DOM/LibXML/ContextNode.pm

filter: Statementstmt 75.0% 21 / 28 Branchbran 0.0% 0 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 68.0% 32 / 47 CC 4 SCAR 22.5
CC
4
Cov
65%
BUILDARGS
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
↑ Summary DOM.pm »
1 # $Id: /mirror/coderepos/lang/perl/MooseX-DOM/trunk/lib/MooseX/DOM/LibXML/ContextNode.pm 68052 2008-08-08T06:27:52.258779Z daisuke $
2  
3 package MooseX::DOM::LibXML::ContextNode;
4 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Class::Inspector;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use XML::LibXML;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use XML::LibXML::XPathContext;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 has 'node' => (
10 is => 'rw',
11 isa => 'XML::LibXML::Element',
12 required => 1,
13 handles => [
14 grep {
15 147 ▶ !/^[0-9A-Z_]+$/ && !/^(?:findnodes|findvalue)$/ } (
Condition100%3/3
/^[0-9A-Z_]+$/ || /^(?:findnodes|findvalue)$/
l!l&&r!l&&!r
242121
MC/DC100%2/2
/^[0-9A-Z_]+$/ || /^(?:findnodes|findvalue)$/
/^[0-9A-Z_]+$/ /^(?:findnodes|findvalue)$/
Truth table100%3/3
A || B
A= /^[0-9A-Z_]+$/B= /^(?:findnodes|findvalue)$/
ABresult
1X1
011
000
16 1 @{ Class::Inspector->methods( 'XML::LibXML::Element', 'public' ) },
17 )
18 ]
19 );
20  
21 1 has 'context' => (
22 is => 'rw',
23 isa => 'XML::LibXML::XPathContext',
24 required => 1,
25 handles => [ qw(findnodes findvalue) ],
26 );
27  
28 1 __PACKAGE__->meta->make_immutable;
29  
30 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 0 ▶sub BUILDARGS {
Subroutine BUILDARGS: not called CC=4 SCAR=30.0
Pod documented
33 0 my ($self, %args) = @_;
34  
35 0 my $xc = XML::LibXML::XPathContext->new($args{node});
36 0 ▶ while (my ($prefix, $uri) = each %{ $args{namespaces} || {} }) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$args{"namespaces"} or {};}) 0 0 0
Condition0%0/2
$args{'namespaces'} || {}
l!l
00
MC/DC0%0/1
$args{'namespaces'} || {}
$args{'namespaces'}
Truth table0%0/2
A
A= $args{'namespaces'}
Aresult
11
00
37 0 ▶ next if defined $xc->lookupNs($uri);
Branch: 1 branch
BranchTrueFalseTotal
if defined $xc->lookupNs($uri) 0 0 0
38  
39 0 $xc->registerNs($prefix, $uri);
40 }
41  
42 0 return { %args, context => $xc };
43 }
44  
45 1 1;
↑ Summary DOM.pm »