blib/lib/Class/Listener.pm

filter: Statementstmt 88.8% 16 / 18 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 81.4% 22 / 27 CC 3 SCAR 9.4
CC
3
Cov
77%
signal
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
↑ Summary
1 package Class::Listener;
2
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 1 our $VERSION = '0.01.04';
8
9 1 our $DEBUG = 0;
10
11 1 our $callback_fmt = "_on_%s";
12
13 1 ▶ sub signal : method
Subroutine signal: called CC=3 SCAR=14.2
Pod documented
14 {
15 1 my $this = shift;
16
17 1 my $event = shift;
18
19 1 my $method = sprintf $callback_fmt, $event;
20
21 1 ▶ return $this->$method( $event, @_ ) if $this->can( $method );
Branch: 1 branch
BranchTrueFalseTotal
if $this->can($method) 1 0 1
22
23 0 ▶ warn "D: $method - unimplemented event called\n" if $DEBUG;
Branch: 1 branch
BranchTrueFalseTotal
if $Class::Listener::DEBUG 0 0 0
24
25 0 return undef;
26 }
27
28 1 1;
29 __END__
↑ Summary