blib/lib/Module/Functions.pm

filter: Statementstmt 100% 39 / 39 Branchbran 90.0% 9 / 10 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 88.5% 62 / 70 CC 8 SCAR 13.3
CC
8
Cov
93%
get_public_functions
7.0
get_full_functions
2.0
BEGIN
1.0
CRAP 3.8
↑ Summary
1 package Module::Functions;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use 5.008005;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 our $VERSION = '2.1.3';
6  
7 3 ▶use parent qw/Exporter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use Sub::Identify ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 our @EXPORT = qw(get_public_functions);
12 3 our @EXPORT_OK = qw(get_full_functions);
13  
14 2 ▶sub get_public_functions {
Subroutine get_public_functions: called CC=7 SCAR=19.5
Pod documented
15 2 ▶ my $klass = shift || caller(0);
Condition66%2/3
shift() || caller 0
l!l&&r!l&&!r
110
MC/DC0%0/2
shift() || caller 0
shift() caller 0
Truth table66%2/3
A || B
A= shift()B= caller 0
ABresult
1X1
011
000
16 2 my @functions;
17 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 my %class = %{"${klass}::"};
19 2 ▶ while (my ($k, $v) = each %class) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %class) 14 2 16
20 14 ▶ next if $k =~ /^(?:BEGIN|UNITCHECK|INIT|CHECK|END|import)$/;
Branch: 1 branch
BranchTrueFalseTotal
if $k =~ /^(?:BEGIN|UNITCHECK|INIT|CHECK|END|import)$/ 3 11 14
21 11 ▶ next if $k =~ /^_/;
Branch: 1 branch
BranchTrueFalseTotal
if $k =~ /^_/ 0 11 11
22 11 ▶ next unless *{"${klass}::${k}"}{CODE};
Branch: 1 branch
BranchTrueFalseTotal
unless *{"${klass}::$k";}{"CODE"} 5 6 11
23 6 ▶ next if $klass ne Sub::Identify::stash_name( $klass->can($k) );
Branch: 1 branch
BranchTrueFalseTotal
if $klass ne &Sub::Identify::stash_name(scalar $klass->can($k)) 4 2 6
24 2 push @functions, $k;
25 }
26 2 return @functions;
27 }
28  
29 1 ▶sub get_full_functions {
Subroutine get_full_functions: called CC=2 SCAR=7.1
Pod documented
30 1 ▶ my $klass = shift || caller(0);
Condition33%1/3
shift() || caller 0
l!l&&r!l&&!r
100
MC/DC0%0/2
shift() || caller 0
shift() caller 0
Truth table33%1/3
A || B
A= shift()B= caller 0
ABresult
1X1
011
000
31 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 return keys %{"${klass}::"};
33 }
34  
35 3 1;
36 __END__
↑ Summary