| 1 | package Class::DBI::Plugin; | ||||||||||||||||||||||||||||
| 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 attributes (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | our $VERSION = 0.03; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | # Code stolen from Simon Cozens (Maypole) | ||||||||||||||||||||||||||||
| 10 | 1 | our %remember; | |||||||||||||||||||||||||||
| 11 | 0 | ▶ | sub MODIFY_CODE_ATTRIBUTES { $remember{ $_[1] } = $_[2]; () } | ||||||||||||||||||||||||||
|
Subroutine
MODIFY_CODE_ATTRIBUTES: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub FETCH_CODE_ATTRIBUTES { $remember{ $_[1] } } | ||||||||||||||||||||||||||
|
Subroutine
FETCH_CODE_ATTRIBUTES: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | sub import | ||||||||||||||||||||||||||||
| 15 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
import: not called CC=6 SCAR=33.9
| |||||||||||||||||||||||||||||
| 16 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 17 | 0 | my $caller = caller; | |||||||||||||||||||||||||||
| 18 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 0 | for my $symname ( keys %{ "$class\::" } ) { | |||||||||||||||||||||||||||
| 20 | 0 | local *sym = ${ "$class\::" }{ $symname }; | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | next unless defined &sym; # We're only in it for the subroutines | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | &sym( $caller ), next | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | if $symname eq 'init'; | ||||||||||||||||||||||||||||
| 24 | 0 | *{ "$caller\::$symname" } = \&sym | |||||||||||||||||||||||||||
| 25 | 0 | ▶ | if grep { defined( $_ ) and $_ eq 'Plugged' } attributes::get( \&sym ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $_ && $_ eq 'Plugged'
MC/DC0%0/2
defined $_ && $_ eq 'Plugged'
defined $_
$_ eq 'Plugged'
Truth table0%0/3
A && B
A= defined $_B= $_ eq 'Plugged'
| |||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 1 | 1; | |||||||||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||||||||||