blib/lib/Class/DBI/Plugin.pm

filter: Statementstmt 50.0% 14 / 28 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod n/a totaltotal 39.1% 18 / 46 CC 6 SCAR 27.4
CC
6
Cov
38%
import
29.7
MODIFY_CODE_ATTRIBUTES
2.0
FETCH_CODE_ATTRIBUTES
2.0
CRAP 15.5
↑ Summary
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
BranchTrueFalseTotal
unless defined &Class::DBI::Plugin::sym 0 0 0
22 0 ▶ &sym( $caller ), next
Branch: 1 branch
BranchTrueFalseTotal
if $symname eq "init" 0 0 0
23 if $symname eq 'init';
24 0 *{ "$caller\::$symname" } = \&sym
25 0 ▶ if grep { defined( $_ ) and $_ eq 'Plugged' } attributes::get( \&sym );
Branch: 1 branch
BranchTrueFalseTotal
if grep {defined $_ and $_ eq "Plugged";} &attributes::get(\&Class::DBI::Plugin::sym) 0 0 0
Condition0%0/3
defined $_ && $_ eq 'Plugged'
!ll&&!rl&&r
000
MC/DC0%0/2
defined $_ && $_ eq 'Plugged'
defined $_ $_ eq 'Plugged'
Truth table0%0/3
A && B
A= defined $_B= $_ eq 'Plugged'
ABresult
0X0
100
111
26 }
27 }
28  
29 1 1;
30 __END__
↑ Summary