XPathScript/Processor/B.pm

filter: Statementstmt 36.3% 12 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 18.7% 3 / 16 Podpod 46.1% 6 / 13 totaltotal 30.4% 21 / 69 CC 4 SCAR 11.2
CC
4
Cov
32%
findnodes
6.0
to_string
6.0
get_attributes
6.0
CRAP 3.1
« XPathScript/Template.pm ↑ Summary XPathScript/Processor/XPath.pm »
1 package XML::XPathScript::Processor::B;
2 1 our $AUTHORITY = 'cpan:YANICK';
3 1 $XML::XPathScript::Processor::B::VERSION = '2.00';
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use base qw/ XML::XPathScript::Processor /;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # No namespaces here
10 0 ▶sub get_namespace { }
Subroutine get_namespace: not called CC=1 SCAR=0.0
Pod undocumented
11  
12 0 ▶sub get_child_nodes { $_[1]->get_children }
Subroutine get_child_nodes: not called CC=1 SCAR=6.9
Pod undocumented
13  
14 0 ▶sub findnodes {
Subroutine findnodes: not called CC=2 SCAR=17.9
Pod documented
15 0 my ( $self, $xpath, $context ) = @_;
16 0 ▶ $context ||= $self->{dom};
Condition0%0/3
$context ||= $self->{"dom"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$context ||= $self->{"dom"}
$context $self->{"dom"}
Truth table0%0/3
A ||= B
A= $contextB= $self->{"dom"}
ABresult
1X1
011
000
17  
18 0 return $context->match( $xpath );
19 }
20  
21 0 ▶sub to_string {
Subroutine to_string: not called CC=2 SCAR=17.9
Pod undocumented
22 0 my ( $self, $node ) = @_;
23  
24 0 my $string = $self->start_tag( $node );
25 0 $string .= $self->to_string( $_ ) for $node->get_children;
26 0 $string .= $self->end_tag( $node );
27
28 0 return $string;
29 }
30  
31 0 ▶sub get_node_name { $_[1]->get_name }
Subroutine get_node_name: not called CC=1 SCAR=6.9
Pod undocumented
32  
33 0 ▶sub get_qualified_name { $_[1]->get_name }
Subroutine get_qualified_name: not called CC=1 SCAR=6.9
Pod undocumented
34  
35 0 ▶sub get_attributes {
Subroutine get_attributes: not called CC=2 SCAR=17.9
Pod undocumented
36 0 ▶ if ( $_[1]->can( 'get_attr_names' ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1]->can("get_attr_names")) 0 0 0
37 0 return map { ( [ $_ => $_[1]->get_attr_value( $_ ) ] )
38 x !! defined $_[1]->get_attr_value( $_ ) }
39 $_[1]->get_attr_names ;
40 }
41  
42 0 return;
43 }
44  
45 0 ▶sub get_attribute { " $_[1][0]='$_[1][1]' " }
Subroutine get_attribute: not called CC=1 SCAR=6.9
Pod undocumented
46  
47 # it's all element nodes
48 0 ▶sub is_element_node { 1 }
Subroutine is_element_node: not called CC=1 SCAR=6.9
Pod documented
49 0 ▶sub is_nodelist { 0 }
Subroutine is_nodelist: not called CC=1 SCAR=6.9
Pod documented
50 0 ▶sub is_text_node { 0 }
Subroutine is_text_node: not called CC=1 SCAR=6.9
Pod documented
51 0 ▶sub is_comment_node { 0 }
Subroutine is_comment_node: not called CC=1 SCAR=6.9
Pod documented
52 0 ▶sub is_pi_node { 0 }
Subroutine is_pi_node: not called CC=1 SCAR=6.9
Pod documented
53  
54 1 1;
55  
56 __END__
« XPathScript/Template.pm ↑ Summary XPathScript/Processor/XPath.pm »