lib/Devel/Trepan/DB/Use.pm

filter: Statementstmt 56.0% 14 / 25 Branchbran 12.5% 1 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 48.7% 20 / 41 CC 5 SCAR 14.4
CC
5
Cov
45%
use_hook
6.4
use_hook
6.4
BEGIN
1.0
CRAP 4.2
« lib/Devel/Trepan/CmdProcessor/Command/Set.pm ↑ Summary lib/Devel/Trepan/CmdProcessor/Command/Show.pm »
1 package Devel::Trepan::DB::Use;
2 =head1 SUMMARY
3  
4 A callback hook for L<Devel::Trepan>'s when I<use> gets called.
5  
6 =cut
7  
8 2 ▶use File::Basename; use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 unshift @INC, \&use_hook;
12 };
13  
14 170 ▶sub use_hook {
Subroutine use_hook: called CC=3 SCAR=18.5
Pod undocumented
15 0 ▶ my ($coderef, $filename) = @_; # $coderef is \&my_sub
Subroutine use_hook: not called CC=3 SCAR=18.5
Pod undocumented
16 ## FIXME: allow for calling the debugger on "use".
17 # print "++use_hook ", $filename, "\n";
18 0 ▶ if ($filename eq 'SelfLoader.pm') {
Branch: 2 branches
BranchTrueFalseTotal
if ($filename eq "SelfLoader.pm") 0 170 170
if ($filename eq "SelfLoader.pm") 0 0 0
19 0 my $dirname = dirname(__FILE__);
20 0 my $SelfLoader_file = File::Spec->catfile($dirname, 'SelfLoader.pm');
21 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
22 0 ▶ open(FH, '<', $SelfLoader_file) or return undef;
Branch: 2 branches
BranchTrueFalseTotal
open FH, "<", $SelfLoader_file or return undef 0 0 0
open FH, "<", $SelfLoader_file or return undef 0 0 0
23 0 return *FH;
24 }
25 return undef
26 0 }
27  
28 2 1;
« lib/Devel/Trepan/CmdProcessor/Command/Set.pm ↑ Summary lib/Devel/Trepan/CmdProcessor/Command/Show.pm »