XPath/Node/Namespace.pm

filter: Statementstmt 41.3% 19 / 46 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 35.7% 5 / 14 Podpod n/a totaltotal 37.5% 24 / 64 CC 3 SCAR 12.7
CC
3
Cov
38%
toString
12.0
new
2.0
getNodeType
2.0
CRAP 3.6
« XPath/NodeSet.pm ↑ Summary XPath/Node/Attribute.pm »
1 package XML::XPath::Node::Namespace;
2  
3 1 $VERSION = '1.26';
4  
5 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use vars qw/@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 @ISA = ('XML::XPath::Node');
9  
10 package XML::XPath::Node::NamespaceImpl;
11  
12 1 ▶use vars qw/@ISA/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 @ISA = ('XML::XPath::NodeImpl', 'XML::XPath::Node::Namespace');
14 1 ▶use XML::XPath::Node ':node_keys';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 sub new {
17 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
18 0 my ($prefix, $expanded) = @_;
19  
20 0 my $pos = XML::XPath::Node->nextPos;
21  
22 0 my @vals;
23 0 @vals[node_global_pos, node_prefix, node_expanded] =
24 ($pos, $prefix, $expanded);
25 0 my $self = \@vals;
26  
27 0 bless $self, $class;
28 }
29  
30 0 ▶sub getNodeType { NAMESPACE_NODE }
Subroutine getNodeType: not called CC=1 SCAR=6.9
31  
32 0 ▶sub isNamespaceNode { 1; }
Subroutine isNamespaceNode: not called CC=1 SCAR=6.9
33  
34 sub getPrefix {
35 0 ▶ my $self = shift;
Subroutine getPrefix: not called CC=1 SCAR=6.9
36 0 $self->[node_prefix];
37 }
38  
39 sub getExpanded {
40 0 ▶ my $self = shift;
Subroutine getExpanded: not called CC=1 SCAR=6.9
41 0 $self->[node_expanded];
42 }
43  
44 sub getValue {
45 0 ▶ my $self = shift;
Subroutine getValue: not called CC=1 SCAR=6.9
46 0 $self->[node_expanded];
47 }
48  
49 sub getData {
50 0 ▶ my $self = shift;
Subroutine getData: not called CC=1 SCAR=6.9
51 0 $self->[node_expanded];
52 }
53  
54 sub string_value {
55 0 ▶ my $self = shift;
Subroutine string_value: not called CC=1 SCAR=6.9
56 0 $self->[node_expanded];
57 }
58  
59 sub toString {
60 0 ▶ my $self = shift;
Subroutine toString: not called CC=3 SCAR=24.8
61 0 my $string = '';
62 0 ▶ return '' unless defined $self->[node_expanded];
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->[4] 0 0 0
63 0 ▶ if ($self->[node_prefix] eq '#default') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->[3] eq '#default') { } 0 0 0
64 0 $string .= ' xmlns="';
65 }
66 else {
67 0 $string .= ' xmlns:' . $self->[node_prefix] . '="';
68 }
69 0 $string .= XML::XPath::Node::XMLescape($self->[node_expanded], '"&<');
70 0 $string .= '"';
71 }
72  
73 1 1;
74 __END__
« XPath/NodeSet.pm ↑ Summary XPath/Node/Attribute.pm »