| 1 | package VS::RuleEngine::Hook; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 23 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 23 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 23 | ▶ | use Carp qw(croak); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 9 | 0 | my $self = shift; | |||||||||||||||||||
| 10 | 0 | ▶ | $self = ref $self || $self; | ||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 11 | 0 | ▶ | croak "new() should not be called as a function" if !$self; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 12 | 0 | croak "Class '$self' does not override new()"; | |||||||||||||||||||
| 13 | } | ||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 3 | ▶ | sub invoke { | ||||||||||||||||||
|
Subroutine
invoke: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 16 | 3 | my $self = shift; | |||||||||||||||||||
| 17 | 3 | ▶ | $self = ref $self || $self; | ||||||||||||||||||
|
Condition100%3/3
ref $self || $self
MC/DC100%2/2
ref $self || $self
ref $self
$self
Truth table100%3/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 18 | 3 | ▶ | croak "invoke() should not be called as a function" if !$self; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 2 | croak "Class '$self' does not override invoke()"; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 23 | 1; | |||||||||||||||||||
| 23 | __END__ | ||||||||||||||||||||