VisitorFactory.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 27 / 27 CC 3 SCAR 6.9
CC
3
Cov
100%
get
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Visitor/GetAllDescendents.pm ↑ Summary Visitor/PreOrderTraversal.pm »
1 package Tree::Simple::VisitorFactory;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.16';
7  
8 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
9 1 my ($class) = @_;
10 1 return bless \$class;
11 }
12  
13 4 ▶sub get {
Subroutine get: called CC=3 SCAR=11.0
Pod documented
14 4 my ($class, $visitor) = @_;
15 4 ▶ (defined($visitor)) || die "Insufficient Arguments : You must specify a Visitor to load";
Branch: 1 branch
BranchTrueFalseTotal
defined $visitor or die "Insufficient Arguments : You must specify a Visitor to load" 3 1 4
16 3 $visitor = "Tree::Simple::Visitor::$visitor";
17 3 eval "require $visitor";
18 3 ▶ die "Illegal Operation : Could not load Visitor ($visitor) because $@" if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 1 2 3
19 2 return $visitor->new();
20 }
21  
22 2 *getVisitor = \&get;
23  
24 2 1;
25  
26 __END__
« Visitor/GetAllDescendents.pm ↑ Summary Visitor/PreOrderTraversal.pm »