| 1 | package AnySan; | ||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | our $VERSION = '0.10'; | |||||||||||
| 5 | |||||||||||||
| 6 | 1 | ▶ | use AnyEvent; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | my $condvar = AE::cv; | |||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub cv { $condvar } | ||||||||||
|
Subroutine
cv: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 11 | |||||||||||||
| 12 | 0 | ▶ | sub run { | ||||||||||
|
Subroutine
run: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 13 | 0 | $condvar->recv; | |||||||||||
| 14 | } | ||||||||||||
| 15 | |||||||||||||
| 16 | |||||||||||||
| 17 | 1 | my @hooks = (); | |||||||||||
| 18 | 0 | ▶ | sub register_listener { | ||||||||||
|
Subroutine
register_listener: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 19 | 0 | my($class, $name, $args) = @_; | |||||||||||
| 20 | 0 | ▶ | $args->{event} ||= 'privmsg'; | ||||||||||
|
Condition0%0/2
$args->{"event"} ||= "privmsg"
MC/DC0%0/1
$args->{"event"} ||= "privmsg"
$args->{"event"}
Truth table0%0/2
A
A= $args->{"event"}
| |||||||||||||
| 21 | 0 | push @hooks, $args; | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 0 | ▶ | sub broadcast_message { | ||||||||||
|
Subroutine
broadcast_message: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 25 | 0 | my($class, $receive) = @_; | |||||||||||
| 26 | |||||||||||||
| 27 | 0 | for my $hook (@hooks) { | |||||||||||
| 28 | 0 | ▶ | next unless $hook->{event} eq $receive->event; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 29 | 0 | $hook->{cb}->($receive); | |||||||||||
| 30 | } | ||||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | 1 | 1; | |||||||||||
| 34 | __END__ | ||||||||||||