Alzabo/ChangeTracker.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 3 totaltotal 34.0% 15 / 44 CC 4 SCAR 13.4
CC
4
Cov
39%
new
6.0
backout
6.0
DESTROY
6.0
CRAP 3.8
« Alzabo/ForeignKey.pm ↑ Summary Alzabo/Column.pm »
1 package Alzabo::ChangeTracker;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 9 ▶use vars qw( $VERSION $STACK @CHANGES );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 $VERSION = 2.0;
8  
9 9 ▶use Params::Validate qw( :all );
Subroutine BEGIN: called CC=1 SCAR=0.0
10 0 ▶Params::Validate::validation_options( on_fail => sub { Alzabo::Exception::Params->throw( error => join '', @_ ) } );
Subroutine __ANON__: not called CC=1 SCAR=1.2
11  
12 9 1;
13  
14 sub new
15 0 ▶{
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
16 0 my $proto = shift;
17 0 ▶ my $class = ref $proto || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
18  
19 0 ++$STACK;
20  
21 0 my $self = $STACK;
22 0 bless \$self, $class;
23 }
24  
25 sub add
26 0 ▶{
Subroutine add: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my $self = shift;
28  
29 0 validate_pos( @_, { type => CODEREF } );
30  
31 0 push @CHANGES, shift;
32 }
33  
34 sub backout
35 0 ▶{
Subroutine backout: not called CC=2 SCAR=17.9
Pod undocumented
36 0 my $self = shift;
37  
38 0 $_->() foreach @CHANGES;
39  
40 0 @CHANGES = ();
41 }
42  
43 sub DESTROY
44 0 ▶{
Subroutine DESTROY: not called CC=2 SCAR=17.9
45 0 --$STACK;
46  
47 0 ▶ @CHANGES = () unless $STACK;
Branch: 1 branch
BranchTrueFalseTotal
unless $Alzabo::ChangeTracker::STACK 0 0 0
48 }
49  
50 __END__
« Alzabo/ForeignKey.pm ↑ Summary Alzabo/Column.pm »