blib/lib/App/cdif/Command.pm

filter: Statementstmt 35.2% 12 / 34 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 4 / 8 Podpod 100% 4 / 4 totaltotal 30.7% 20 / 65 CC 10 SCAR 36.0
CC
10
Cov
23%
option
72.0
command
12.0
stdin
2.0
CRAP 36.5
« script/sdif ↑ Summary script/cdif »
1 package App::cdif::Command;
2  
3 16 ▶use v5.14;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 16 ▶use parent 'Command::Run';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # Compatibility: expand array reference in command
10 0 ▶sub command {
Subroutine command: not called CC=3 SCAR=24.8
Pod documented
11 0 my $obj = shift;
12 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
13 0 ▶ my @cmd = map { ref eq 'ARRAY' ? @$_ : $_ } @_;
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq 'ARRAY' ? : 0 0 0
14 0 return $obj->SUPER::command(@cmd);
15 }
16 0 $obj->SUPER::command;
17 }
18  
19 # Compatibility wrapper for read_error option
20 0 ▶sub option {
Subroutine option: not called CC=8 SCAR=42.8
Pod documented
21 0 my $obj = shift;
22 0 ▶ if (@_ == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1) { } 0 0 0
23 0 my $key = shift;
24 0 ▶ if ($key eq 'read_error') {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "read_error") 0 0 0
25 0 ▶ my $stderr = $obj->SUPER::option('stderr') // '';
Condition0%0/2
$obj->SUPER::option("stderr") // ""
l!l
00
MC/DC0%0/1
$obj->SUPER::option("stderr") // ""
$obj->SUPER::option("stderr")
Truth table0%0/2
A
A= $obj->SUPER::option("stderr")
Aresult
11
00
26 0 ▶ return $stderr eq 'redirect' ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$stderr eq 'redirect' ? : 0 0 0
27 }
28 0 return $obj->SUPER::option($key);
29 } else {
30 0 ▶ while (my($k, $v) = splice @_, 0, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@_, 0, 2)) 0 0 0
31 0 ▶ if ($k eq 'read_error') {
Branch: 1 branch
BranchTrueFalseTotal
if ($k eq 'read_error') { } 0 0 0
32 0 ▶ $obj->SUPER::option(stderr => $v ? 'redirect' : undef);
Branch: 1 branch
BranchTrueFalseTotal
$v ? : 0 0 0
33 } else {
34 0 $obj->SUPER::option($k => $v);
35 }
36 }
37 0 return $obj;
38 }
39 }
40  
41 # Compatibility: return INPUT filehandle
42 0 ▶sub stdin {
Subroutine stdin: not called CC=1 SCAR=6.9
Pod documented
43 0 my $obj = shift;
44 0 $obj->{INPUT};
45 }
46  
47 # Compatibility: setstdin method
48 0 ▶sub setstdin {
Subroutine setstdin: not called CC=1 SCAR=6.9
Pod documented
49 0 my $obj = shift;
50 0 $obj->with(stdin => shift);
51 }
52  
53 16 1;
54  
55 __END__
« script/sdif ↑ Summary script/cdif »