ADB/Util.pm

filter: Statementstmt 87.1% 27 / 31 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 3 / 3 totaltotal 85.1% 40 / 47 CC 3 SCAR 3.9
CC
3
Cov
83%
croak_unknown_params
2.1
wantlist
2.1
shell_quote
2.0
CRAP 1.5
« ADB/Shell/Result.pm ↑ Summary
1 package Net::ADB::Util;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use v5.16;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 our $VERSION = '0.01';
12  
13 2 our @EXPORT_OK = qw(wantlist croak_unknown_params shell_quote);
14 2 our @CARP_NOT = qw(Net::ADB Net::ADB::Device);
15  
16 # Must be called as the expression of a "return": the caller's context is
17 # passed through (return wantlist(\@list), not my $x = wantlist(...))
18 1 ▶sub wantlist { wantarray ? @{$_[0]} : $_[0] }
Subroutine wantlist: called CC=2 SCAR=7.2
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 1 0 1
19  
20 2 ▶sub croak_unknown_params {
Subroutine croak_unknown_params: called CC=2 SCAR=7.4
Pod documented
21 2 my $params = shift;
22 0 ▶ Carp::croak('Unknown parameters: ' . join ', ', sort keys %{$params}) if %{$params};
Branch: 1 branch
BranchTrueFalseTotal
if %{$params;} 0 2 2
23 2 return;
24 }
25  
26 0 ▶sub shell_quote {
Subroutine shell_quote: not called CC=1 SCAR=6.9
Pod documented
27 0 my $string = shift;
28 0 $string =~ s/'/'\\''/g;
29 0 return "'$string'";
30 }
31  
32 2 1;
33  
34 __END__
« ADB/Shell/Result.pm ↑ Summary