Schema/Node.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 66.6% 2 / 3 totaltotal 77.2% 17 / 22 CC 3 SCAR 6.1
CC
3
Cov
80%
new
2.0
parse
2.0
is_root
2.0
CRAP 1.8
« Schema/Util.pm ↑ Summary Schema/ComplexTypeNode.pm »
1 package XML::Validator::Schema::Node;
2 5 ▶use base qw(Tree::DAG_Node);
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 =head1 NAME
5  
6 XML::Validator::Schema::Node
7  
8 =head1 DESCRIPTION
9  
10 Base class for nodes in the schema tree. Used by both temporary nodes
11 resolved during compilation (ex. ::ModelNode) and permanent nodes
12 (ex. ::ElementNode).
13  
14 This is an abstract base class and may not be directly instantiated.
15  
16 =cut
17  
18 439 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod documented
19 439 my $pkg = shift;
20 439 ▶ croak("Illegal attempt to instantiate a Node directly!")
Branch: 1 branch
BranchTrueFalseTotal
if $pkg eq __PACKAGE__ 0 439 439
21 if $pkg eq __PACKAGE__;
22 439 return $pkg->SUPER::new(@_);
23 }
24  
25 0 ▶sub parse {
Subroutine parse: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my $pkg = shift;
27 0 croak("$pkg neglected to supply a parse() implementation!");
28 }
29  
30 # override to declare root-ness
31 133 ▶sub is_root {
Subroutine is_root: called CC=2 SCAR=6.9
Pod documented
32 133 ▶ return 0 if shift->{mother};
Branch: 1 branch
BranchTrueFalseTotal
if +(shift())->{"mother"} 99 34 133
33 34 return 1;
34 }
35  
36 5 1;
37  
« Schema/Util.pm ↑ Summary Schema/ComplexTypeNode.pm »