blib/lib/autobox/String/Inflector.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 31 / 31 CC 2 SCAR 2.2
CC
2
Cov
100%
singularize
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package autobox::String::Inflector;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 our $VERSION = '0.02';
6  
7 2 ▶use base qw(autobox);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
10 2 shift->SUPER::import(STRING => 'autobox::String::Inflector::Impl', @_);
11 }
12  
13 package # hide from pause
14 autobox::String::Inflector::Impl;
15  
16 2 ▶use String::CamelCase qw(camelize decamelize);
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use Lingua::EN::Inflect::Number ();
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 2 *pluralize = \&Lingua::EN::Inflect::Number::to_PL;
20  
21 2 ▶sub singularize {
Subroutine singularize: called CC=2 SCAR=6.9
22 2 local $_ = shift;
23 2 ▶ return $_ if s/(alias|status)es$/$1/i;
Branch: 1 branch
BranchTrueFalseTotal
if s/(alias|status)es$/$1/i 1 1 2
24 1 return Lingua::EN::Inflect::Number::to_S($_);
25 }
26  
27 2 1;
28 __END__
↑ Summary