blib/lib/exact/cli.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 81.4% 35 / 43 CC 6 SCAR 13.7
CC
6
Cov
85%
import
6.2
podhelp
2.0
BEGIN
1.0
CRAP 3.9
↑ Summary
1 package exact::cli;
2 # ABSTRACT: Command-line interface helper utilities extension for exact
3  
4 2 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use exact;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Util::CommandLine 1.04 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '1.09'; # VERSION
9  
10 1 ▶sub import {
Subroutine import: called CC=6 SCAR=18.2
11 1 my ( $self, $params, $caller ) = @_;
12 1 ▶ $caller //= caller();
Condition33%1/3
$caller //= caller()
l!l&&r!l&&!r
100
MC/DC0%0/2
$caller //= caller()
$caller caller()
Truth table33%1/3
A //= B
A= $callerB= caller()
ABresult
1X1
011
000
13  
14 1 my @methods = qw( options pod2usage readmode singleton );
15 {
16 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 for (@methods) {
19 4 my $method = "Util::CommandLine::$_";
20 4 ▶ *{ $caller . '::' . $_ } = \&$method unless ( defined &{ $caller . '::' . $_ } );
Branch: 1 branch
BranchTrueFalseTotal
unless defined &{$caller . '::' . $_;} 4 0 4
21 }
22  
23 1 for ('podhelp') {
24 1 ▶ *{ $caller . '::' . $_ } = \&$_ unless ( defined &{ $caller . '::' . $_ } );
Branch: 1 branch
BranchTrueFalseTotal
unless defined &{$caller . '::' . $_;} 1 0 1
25 }
26 }
27 }
28  
29 0 ▶sub podhelp {
Subroutine podhelp: not called CC=1 SCAR=6.9
Pod documented
30 0 Util::CommandLine::options();
31 }
32  
33 2 1;
34  
35 __END__
↑ Summary