| 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
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | __END__ | ||||||||||||||||||||