lib/UNIVERSAL/source_location_for.pm

filter: Statementstmt 69.5% 16 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 61.7% 21 / 34 CC 3 SCAR 16.3
CC
3
Cov
59%
source_location_for
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
↑ Summary script/source_location.pl »
1 package UNIVERSAL::source_location_for;
2 2 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.11';
7  
8 2 ▶use B ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Carp qw(carp);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 0 ▶sub UNIVERSAL::source_location_for {
Subroutine source_location_for: not called CC=3 SCAR=24.8
Pod undocumented
12 0 my($self, $method) = @_;
13 0 my $entity = $self->can($method);
14  
15 0 ▶ unless ($entity) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($entity) 0 0 0
16 0 ▶ carp ("Undefined subroutine " . (ref $self ? ref $self : $self) . "::" . $method);
Branch: 1 branch
BranchTrueFalseTotal
ref $self ? : 0 0 0
17 0 return();
18 }
19  
20 0 my $gv = B::svref_2object($entity)->GV;
21 0 return($gv->FILE, $gv->LINE);
22 }
23  
24 2 1;
25 __END__
↑ Summary script/source_location.pl »