Utils/UriEscape.pm

filter: Statementstmt 100% 30 / 30 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 90.9% 40 / 44 CC 3 SCAR 4.8
CC
3
Cov
94%
process
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« Utils/Date.pm ↑ Summary Utils/LowerCase.pm »
1 package Petal::Utils::UriEscape;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use URI::Escape qw( &uri_escape );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use base qw( Petal::Utils::Base );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use constant name => 'uri_escape';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use constant aliases => qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 3 our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1];
15 3 our $REVISION = (split(/ /, ' $Revision: 1.1 $ '))[2];
16  
17 7 ▶sub process {
Subroutine process: called CC=3 SCAR=11.2
Pod undocumented
18 7 my $self = shift;
19 7 my $hash = shift;
20 7 ▶ my $args = shift || confess( "'uri_escape' expects a variable (got nothing)" );
Condition50%1/2
shift() || confess(q['uri_escape' expects a variable (got nothing)])
l!l
70
MC/DC0%0/1
shift() || confess(q['uri_escape' expects a variable (got nothing)])
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
21 7 my $result = $hash->fetch( $args );
22 7 ▶ return unless length( $result ); # do nothing if $args evaluates to nothing
Branch: 1 branch
BranchTrueFalseTotal
unless length $result 0 7 7
23 7 return uri_escape( $result );
24 }
25  
26 3 1;
« Utils/Date.pm ↑ Summary Utils/LowerCase.pm »