blib/lib/Templ/Header.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 80.3% 41 / 51 CC 4 SCAR 7.9
CC
4
Cov
85%
add
4.3
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« blib/lib/Templ/Spec/XML.pm ↑ Summary blib/lib/Templ/Tag/Print.pm »
1 package Templ::Header;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Carp qw(carp croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use overload '""' => sub { my $self = shift; $$self };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
9  
10 sub add {
11 2 ▶ my $class = shift;
Subroutine add: called CC=4 SCAR=14.5
Pod undocumented
12 2 ▶ if ( not defined $class || ref $class || $class !~ m/^(\w+\:\:)*\w+$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $class or ref $class or not $class =~ /^(\w+\:\:)*\w+$/) 0 2 2
Condition33%2/6
defined $class or ref $class or not $class =~ /^(\w+\:\:)*\w+$/
l!l&&r!l&&!r
200
defined $class or ref $class
l!l&&r!l&&!r
200
MC/DC0%0/3
defined $class or ref $class or not $class =~ /^(\w+\:\:)*\w+$/
defined $class ref $class not $class =~ /^(\w+\:\:)*\w+$/
Truth table25%1/4
A or B or not(C)
A= defined $classB= ref $classC= not $class =~ /^(\w+\:\:)*\w+$/
ABCresult
1XX1
01X1
0011
0000
13 0 croak "Can only be called as ".__PACKAGE__."->new";
14 }
15 2 my $self = \($_[0].'');
16 2 bless $self, $class;
17 2 my $target_class = caller;
18 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 push @{ $target_class.'::TEMPL_HEADERS' }, $self;
21 2 return $self;
22 }
23  
24 1 *new = *add;
25  
26 1 1;
« blib/lib/Templ/Spec/XML.pm ↑ Summary blib/lib/Templ/Tag/Print.pm »