lib/XML/XMetaL/Mock/DOMText.pm

filter: Statementstmt 100% 52 / 52 Branchbran 75.0% 3 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 14 / 14 Podpod 0.0% 0 / 1 totaltotal 92.1% 70 / 76 CC 4 SCAR 3.9
CC
4
Cov
95%
new
3.0
STORE
2.0
BEGIN
1.0
CRAP 1.5
« blib/lib/XML/gmcr.pl ↑ Summary lib/XML/XMetaL/Utilities/Abstract.pm »
1 package XML::XMetaL::Mock::DOMText::Tie;
2
3 2 ▶use Tie::Hash;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base 'Tie::StdHash';
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6 3 ▶sub TIEHASH {
Subroutine TIEHASH: called CC=1 SCAR=0.0
7 3 my ($class, $object) = @_;
8 3 my $self = bless $object, $class;
9 3 return $self;
10 }
11
12 5 ▶sub STORE {
Subroutine STORE: called CC=2 SCAR=6.9
13 5 my ($self, $key, $value) = @_;
14 5 $self->{$key} = $value;
15 5 ▶ $self->{length} = length $value if $key eq 'data';
Branch: 1 branch
BranchTrueFalseTotal
if $key eq "data" 2 3 5
16 }
17
18 package XML::XMetaL::Mock::DOMText;
19
20 2 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23
24 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶use Hash::Util qw(lock_keys);
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use Tie::Hash;
Subroutine BEGIN: called CC=1 SCAR=0.0
27
28 2 ▶use base ('Tie::StdHash', 'XML::XMetaL::Mock::DOMNode');
Subroutine BEGIN: called CC=1 SCAR=0.0
29
30 2 ▶use constant TRUE => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 2 ▶use constant FALSE => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
32
33 2 our @keys = qw(
34 data
35 length
36 );
37
38
39 3 ▶sub new {
Subroutine new: called CC=3 SCAR=11.1
Pod undocumented
40 3 my ($class, %args) = @_;
41 #my $self;
42 3 my %self;
43 my $self;
44 3 eval {
45 3 my %properties;
46 3 @properties{@keys} = @args{@keys};
47 3 my $super_class = $class->SUPER::new(%args);
48 3 %properties = (
49 %$super_class,
50 %properties,
51 );
52 3 tie %self, 'XML::XMetaL::Mock::DOMText::Tie', \%properties;
53 3 ▶ $self = bless \%self, ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
54 3 lock_keys(%$self, keys %$self);
55
56 };
57 3 ▶ croak $@ if $@;
Branch: 1 branch
BranchTrueFalseTotal
if $@ 0 3 3
58 3 return $self;
59 }
60
61
62
63 2 1;
64 __END__
« blib/lib/XML/gmcr.pl ↑ Summary lib/XML/XMetaL/Utilities/Abstract.pm »