| 1 | 1 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 2 | package Event::group; | ||||||||||||||
| 3 | 1 | ▶ | use Carp; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 1 | ▶ | use base 'Event::Watcher'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 1 | ▶ | use vars qw(@ATTRIBUTE); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | 1 | @ATTRIBUTE = qw(timeout); | |||||||||||||
| 8 | |||||||||||||||
| 9 | 1 | 'Event::Watcher'->register; | |||||||||||||
| 10 | |||||||||||||||
| 11 | 1 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=6 SCAR=19.0
Pod
undocumented
| |||||||||||||||
| 12 | 1 | my $class = shift; | |||||||||||||
| 13 | 1 | my %arg; | |||||||||||||
| 14 | my @add; | ||||||||||||||
| 15 | 1 | ▶ | while (my ($k,$v) = splice(@_, 0, 2)) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 16 | 2 | ▶ | if ($k eq 'add') { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 17 | 0 | push @add, $v; | |||||||||||||
| 18 | } elsif ($k eq 'del') { | ||||||||||||||
| 19 | 0 | carp "del in constructor (ignored)"; | |||||||||||||
| 20 | } else { | ||||||||||||||
| 21 | 2 | $arg{$k} = $v; | |||||||||||||
| 22 | } | ||||||||||||||
| 23 | } | ||||||||||||||
| 24 | 1 | ▶ | my $o = allocate($class, delete $arg{attach_to} || {}); | ||||||||||||
|
Condition50%1/2
delete $arg{'attach_to'} || {}
MC/DC0%0/1
delete $arg{'attach_to'} || {}
delete $arg{'attach_to'}
Truth table50%1/2
A
A= delete $arg{'attach_to'}
| |||||||||||||||
| 25 | 1 | $o->init(\%arg); | |||||||||||||
| 26 | 1 | $o->add($_) for @add; | |||||||||||||
| 27 | 1 | $o; | |||||||||||||
| 28 | } | ||||||||||||||
| 29 | |||||||||||||||
| 30 | 1 | 1; | |||||||||||||