OpenSSH/ShellQuoter.pm

filter: Statementstmt 92.0% 23 / 25 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 80.4% 33 / 41 CC 6 SCAR 15.7
CC
6
Cov
80%
quoter
7.3
BEGIN
1.0
BEGIN
1.0
CRAP 4.8
« OpenSSH/ModuleLoader.pm ↑ Summary OpenSSH/ShellQuoter/MSCmd.pm »
1 package Net::OpenSSH::ShellQuoter;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Net::OpenSSH::ModuleLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 my %alias = (bash => 'POSIX',
10 sh => 'POSIX',
11 ksh => 'POSIX',
12 ash => 'POSIX',
13 dash => 'POSIX',
14 pdksh => 'POSIX',
15 mksh => 'POSIX',
16 lksh => 'POSIX',
17 zsh => 'POSIX',
18 fizsh => 'POSIX',
19 posh => 'POSIX',
20 fish => 'fish',
21 tcsh => 'csh');
22  
23 3 ▶sub quoter {
Subroutine quoter: called CC=6 SCAR=19.9
Pod undocumented
24 3 my ($class, $shell) = @_;
25 3 ▶ $shell = 'POSIX' unless defined $shell;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $shell 0 3 3
26 3 ▶ return $shell if ref $shell;
Branch: 1 branch
BranchTrueFalseTotal
if ref $shell 0 3 3
27 3 ▶ if ($shell =~ /,/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($shell =~ /,/) { } 0 3 3
28 0 require Net::OpenSSH::ShellQuoter::Chain;
29 0 return Net::OpenSSH::ShellQuoter::Chain->chain(split /\s*,\s*/, $shell);
30 }
31 else {
32 3 ▶ $shell = $alias{$shell} if defined $alias{$shell};
Branch: 1 branch
BranchTrueFalseTotal
if defined $alias{$shell} 3 0 3
33 3 ▶ $shell =~ /^\w+$/ or croak "bad quoting style $shell";
Branch: 1 branch
BranchTrueFalseTotal
$shell =~ /^\w+$/ or croak("bad quoting style $shell") 3 0 3
34 3 my $impl = "Net::OpenSSH::ShellQuoter::$shell";
35 3 _load_module($impl);
36 3 return $impl->new;
37 }
38 }
39  
40 5 1;
« OpenSSH/ModuleLoader.pm ↑ Summary OpenSSH/ShellQuoter/MSCmd.pm »