APIClient/Utils/FormArray.pm

filter: Statementstmt 100% 19 / 19 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 92.8% 26 / 28 CC 3 SCAR 6.9
CC
3
Cov
96%
to_kv_equals_strings
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« APIClient/Request/WHM1.pm ↑ Summary APIClient/TransportBase/HTTPBase.pm »
1 package cPanel::APIClient::Utils::FormArray;
2  
3 # Copyright 2020 cPanel, L. L. C.
4 # All rights reserved.
5 # http://cpanel.net
6 #
7 # This is free software; you can redistribute it and/or modify it under the
8 # same terms as Perl itself. See L<perlartistic>.
9  
10 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use URI::Escape ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 10 ▶sub to_kv_equals_strings {
Subroutine to_kv_equals_strings: called CC=3 SCAR=11.0
Pod undocumented
16 10 my ($args_hr) = @_;
17  
18 return map {
19 10 ▶ defined( $args_hr->{$_} ) or die "undef value ($_) is invalid!";
Branch: 1 branch
BranchTrueFalseTotal
defined $args_hr->{$_} or die "undef value ($_) is invalid!" 10 0 10
20  
21 10 ▶ if ( 'ARRAY' eq ref $args_hr->{$_} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ('ARRAY' eq ref $args_hr->{$_}) { } 2 8 10
22 2 my $key_u = URI::Escape::uri_escape($_);
23 2 map { "$key_u=" . URI::Escape::uri_escape($_) } @{ $args_hr->{$_} };
24 }
25 else {
26 8 URI::Escape::uri_escape($_) . '=' . URI::Escape::uri_escape( $args_hr->{$_} );
27 }
28 } keys %$args_hr;
29 }
30  
31 3 1;
« APIClient/Request/WHM1.pm ↑ Summary APIClient/TransportBase/HTTPBase.pm »