Utils/Sort.pm

filter: Statementstmt 100% 27 / 27 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 90.0% 36 / 40 CC 3 SCAR 5.3
CC
3
Cov
94%
process
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Utils/Keys.pm ↑ Summary Utils/Each.pm »
1 package Petal::Utils::Sort;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use base qw( Petal::Utils::Base );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use constant name => 'sort';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use constant aliases => qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 our $VERSION = ((require Petal::Utils), $Petal::Utils::VERSION)[1];
14 4 our $REVISION = (split(/ /, ' $Revision: 1.3 $ '))[2];
15  
16 1 ▶sub process {
Subroutine process: called CC=3 SCAR=11.2
Pod undocumented
17 1 my $class = shift;
18 1 my $hash = shift;
19 1 ▶ my $args = shift || confess( "'sort' expects an array ref (got nothing)!" );
Condition50%1/2
shift() || confess(q['sort' expects an array ref (got nothing)!])
l!l
10
MC/DC0%0/1
shift() || confess(q['sort' expects an array ref (got nothing)!])
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
20  
21 1 my $result = $hash->fetch( $args );
22  
23 1 ▶ confess( "1st arg to 'sort' is not an array ($args = $result)!" )
Branch: 1 branch
BranchTrueFalseTotal
unless ref $result eq "ARRAY" 0 1 1
24 unless ref($result) eq 'ARRAY'; # ignore object for now
25  
26 1 return [ sort @$result ];
27 }
28  
29 4 1;
« Utils/Keys.pm ↑ Summary Utils/Each.pm »