RemoteCommand/Util.pm

filter: Statementstmt 52.7% 19 / 36 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 2 totaltotal 49.0% 26 / 53 CC 4 SCAR 10.7
CC
4
Cov
48%
logger
6.0
prompt
6.0
BEGIN
2.0
CRAP 2.9
« RemoteCommand/Pool.pm ↑ Summary
1 package App::RemoteCommand::Util;
2 1 ▶use v5.24;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use experimental qw(lexical_subs signatures);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 our @EXPORT_OK = qw(prompt DEBUG logger);
8  
9 1 ▶use constant DEBUG => $ENV{PERL_RCOMMAND_DEBUG} ? 1 : 0;
Subroutine BEGIN: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
$ENV{'PERL_RCOMMAND_DEBUG'} ? : 0 1 1
10  
11 1 ▶use Term::ReadKey 'ReadMode';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub logger (@args) {
Subroutine logger: not called CC=2 SCAR=17.9
Pod undocumented
14 0 ▶ my $msg = @args == 1 ? $args[0] : sprintf shift(@args), @args;
Branch: 1 branch
BranchTrueFalseTotal
@args == 1 ? : 0 0 0
15 0 warn " | $msg\n";
16 }
17  
18 0 ▶sub prompt ($msg) {
Subroutine prompt: not called CC=2 SCAR=17.9
Pod undocumented
19 0 local $| = 1;
20 0 print $msg;
21 0 ReadMode 'noecho', \*STDIN;
22 0 my $SIGNAL = "Catch SIGINT\n";
23 0 my $answer;
24 0 eval {
25 0 ▶ local $SIG{INT} = sub (@) { die $SIGNAL };
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 $answer = <STDIN>;
27 };
28 0 my $error = $@;
29 0 ReadMode 'restore', \*STDIN;
30 0 print "\n";
31 0 ▶ die $error if $error;
Branch: 1 branch
BranchTrueFalseTotal
if $error 0 0 0
32 0 chomp $answer;
33 0 $answer;
34 }
35  
36 1 1;
« RemoteCommand/Pool.pm ↑ Summary