Utils/Date.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/Printf.pm ↑ Summary Utils/UriEscape.pm »
1 package Petal::Utils::Date;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Date::Format;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use base qw( Petal::Utils::Base );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶use constant name => 'date';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use constant aliases => qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1];
15 2 our $REVISION = (split(/ /, ' $Revision: 1.2 $ '))[2];
16  
17 1 ▶sub process {
Subroutine process: called CC=3 SCAR=11.2
Pod undocumented
18 1 my $self = shift;
19 1 my $hash = shift;
20 1 ▶ my $args = shift || confess( "'date' expects a variable (got nothing)" );
Condition50%1/2
shift() || confess(q['date' expects a variable (got nothing)])
l!l
10
MC/DC0%0/1
shift() || confess(q['date' expects a variable (got nothing)])
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
21 1 my $result = $hash->fetch( $args );
22 1 ▶ return unless length($result); # do nothing if $args evaluates to nothing
Branch: 1 branch
BranchTrueFalseTotal
unless length $result 0 1 1
23 1 return time2str('%b %e %Y %T', $result);
24 }
25  
26 2 1;
« Utils/Printf.pm ↑ Summary Utils/UriEscape.pm »