lib/Rex/Helper/URI.pm

filter: Statementstmt 53.8% 7 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 9 / 18 CC 1 SCAR 4.1
CC
1
Cov
54%
encode
2.0
_encode_char
2.0
BEGIN
1.0
CRAP 1.5
« lib/Rex/Inventory/DMIDecode/CPU.pm ↑ Summary lib/Rex/Constants.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Helper::URI;
6  
7 1 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $VERSION = '1.16.1'; # VERSION
11  
12 0 ▶sub encode {
Subroutine encode: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my ($part) = @_;
14 0 $part =~ s/([^\w\-\.\@])/_encode_char($1)/eg;
15 0 return $part;
16 }
17  
18 0 ▶sub _encode_char {
Subroutine _encode_char: not called CC=1 SCAR=6.9
19 0 my ($char) = @_;
20 0 return "%" . sprintf "%lx", ord($char);
21 }
22  
23 1 1;
« lib/Rex/Inventory/DMIDecode/CPU.pm ↑ Summary lib/Rex/Constants.pm »