Ask/Fallback.pm

filter: Statementstmt 51.0% 25 / 49 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 8 / 16 Podpod 0.0% 0 / 9 totaltotal 36.2% 33 / 91 CC 8 SCAR 18.2
CC
8
Cov
39%
file_selection
20.0
question
6.0
entry
6.0
CRAP 6.2
« Ask/STDIO.pm ↑ Summary Ask/Functions.pm »
1 3 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
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  
5 package Ask::Fallback;
6  
7 3 our $AUTHORITY = 'cpan:TOBYINK';
8 3 our $VERSION = '0.015';
9  
10 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Path::Tiny qw(path);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 with 'Ask::API';
16  
17 9 ▶sub quality {
Subroutine quality: called CC=1 SCAR=0.0
Pod undocumented
18 9 return 1;
19 }
20  
21 0 ▶sub info {
Subroutine info: not called CC=1 SCAR=6.9
Pod undocumented
22 0 my ( $self, %o ) = @_;
23 0 print STDERR "$o{text}\n";
24 }
25  
26 0 ▶sub warning {
Subroutine warning: not called CC=1 SCAR=6.9
Pod undocumented
27 0 my ( $self, %o ) = @_;
28 0 print STDERR "WARNING: $o{text}\n";
29 }
30  
31 0 ▶sub error {
Subroutine error: not called CC=1 SCAR=6.9
Pod undocumented
32 0 my ( $self, %o ) = @_;
33 0 print STDERR "ERROR: $o{text}\n";
34 }
35  
36 0 ▶sub question {
Subroutine question: not called CC=2 SCAR=17.9
Pod undocumented
37 0 my ( $self, %o ) = @_;
38 0 ▶ exists $o{default} and return $o{default};
Branch: 1 branch
BranchTrueFalseTotal
exists $o{"default"} and return $o{"default"} 0 0 0
39 0 croak "question (Ask::Fallback) with no default";
40 }
41  
42 0 ▶sub entry {
Subroutine entry: not called CC=2 SCAR=17.9
Pod undocumented
43 0 my ( $self, %o ) = @_;
44 0 ▶ exists $o{default} and return $o{default};
Branch: 1 branch
BranchTrueFalseTotal
exists $o{"default"} and return $o{"default"} 0 0 0
45 0 croak "entry (Ask::Fallback) with no default";
46 }
47  
48 0 ▶sub file_selection {
Subroutine file_selection: not called CC=4 SCAR=30.0
Pod undocumented
49 0 my ( $self, %o ) = @_;
50 0 ▶ $o{multiple} and exists $o{default} and return map path( $_ ), @{ $o{default} };
Branch: 1 branch
BranchTrueFalseTotal
$o{"multiple"} and exists $o{"default"} and return map(path($_), @{$o{"default"};}) 0 0 0
Condition0%0/3
$o{"multiple"} and exists $o{"default"}
!ll&&!rl&&r
000
MC/DC0%0/2
$o{"multiple"} and exists $o{"default"}
$o{"multiple"} exists $o{"default"}
Truth table0%0/3
A and B
A= $o{"multiple"}B= exists $o{"default"}
ABresult
0X0
100
111
51 0 ▶ exists $o{default} and return path $o{default};
Branch: 1 branch
BranchTrueFalseTotal
exists $o{"default"} and return path($o{"default"}) 0 0 0
52 0 croak "file_selection (Ask::Fallback) with no default";
53 }
54  
55 0 ▶sub single_choice {
Subroutine single_choice: not called CC=2 SCAR=17.9
Pod undocumented
56 0 my ( $self, %o ) = @_;
57 0 ▶ exists $o{default} and return $o{default};
Branch: 1 branch
BranchTrueFalseTotal
exists $o{"default"} and return $o{"default"} 0 0 0
58 0 croak "single_choice (Ask::Fallback) with no default";
59 }
60  
61 0 ▶sub multiple_choice {
Subroutine multiple_choice: not called CC=2 SCAR=17.9
Pod undocumented
62 0 my ( $self, %o ) = @_;
63 0 ▶ exists $o{default} and return @{ $o{default} };
Branch: 1 branch
BranchTrueFalseTotal
exists $o{"default"} and return @{$o{"default"};} 0 0 0
64 0 croak "multiple_choice (Ask::Fallback) with no default";
65 }
66  
67 3 1;
68  
69 __END__
« Ask/STDIO.pm ↑ Summary Ask/Functions.pm »