Sandbox/StringFunctions.pm

filter: Statementstmt 84.6% 22 / 26 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod n/a totaltotal 86.0% 37 / 43 CC 4 SCAR 5.2
CC
4
Cov
81%
__ANON__
2.9
__ANON__
2.9
__ANON__
2.0
CRAP 1.7
« Sandbox/NumberFunctions.pm ↑ Summary
1 package Template::Sandbox::StringFunctions;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use base 'Template::Sandbox::Library';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 ▶use Template::Sandbox qw/:function_sugar/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 $Template::Sandbox::StringFunctions::VERSION = '1.04';
11  
12 __PACKAGE__->set_library_functions(
13 1 ▶ lc => ( one_arg sub { lc( $_[ 0 ] ) } ),
Subroutine __ANON__: called CC=1 SCAR=0.0
14 lcfirst => ( one_arg
15 1 ▶ sub { ref( $_[ 0 ] ) ?
Subroutine __ANON__: called CC=2 SCAR=10.5
16 0 ▶ [ map { lcfirst( $_ ) } @{$_[ 0 ]} ] : lcfirst( $_[ 0 ] ) } ),
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 1 1
17 1 ▶ uc => ( one_arg sub { uc( $_[ 0 ] ) } ),
Subroutine __ANON__: called CC=1 SCAR=0.0
18 ucfirst => ( one_arg
19 2 ▶ sub { ref( $_[ 0 ] ) ?
Subroutine __ANON__: called CC=2 SCAR=10.5
20 0 ▶ [ map { ucfirst( $_ ) } @{$_[ 0 ]} ] : ucfirst( $_[ 0 ] ) } ),
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 2 2
21 2 ▶ substr => ( three_args sub { substr( $_[ 0 ], $_[ 1 ], $_[ 2 ] ) } ),
Subroutine __ANON__: called CC=1 SCAR=0.0
22 1 ▶ length => ( one_arg sub { length( $_[ 0 ] ) } ),
Subroutine __ANON__: called CC=1 SCAR=0.0
23 possessive =>
24 2 ▶ ( one_arg sub { $_[ 0 ] . ( $_[ 0 ] =~ /s$/ ? "'" : "'s" ) } ),
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
$_[0] =~ /s$/ ? : 1 1 2
25 );
26  
27 4 1;
28  
29 __END__
« Sandbox/NumberFunctions.pm ↑ Summary