Normal/Type/City.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 97.0% 33 / 34 CC 3 SCAR 5.6
CC
3
Cov
96%
transform
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Normal/Config.pm ↑ Summary Normal/Config/States.pm »
1 package String::Normal::Type::City;
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use String::Normal::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use String::Normal::Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 our $address_stem;
8  
9 2 ▶sub transform {
Subroutine transform: called CC=3 SCAR=11.0
Pod documented
10 2 my ($self,$value) = @_;
11  
12 2 $value = String::Normal::Type::_scrub_value( $value );
13  
14 # TODO: refactor this code and remove dependencies on %address_stem
15 # single spaced records are guaranteed
16 2 my @tokens = ();
17 2 for my $token (split ' ', $value) {
18 4 ▶ $token = defined( $address_stem->{$token} ) ? $address_stem->{$token} : $token;
Branch: 1 branch
BranchTrueFalseTotal
defined $String::Normal::Type::City::address_stem->{$token} ? : 0 4 4
19 4 push @tokens, $token;
20 }
21  
22 2 $value = join ' ', @tokens;
23 }
24  
25 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
26 1 my $self = shift;
27 1 $address_stem = String::Normal::Config::AddressStem::_data( @_ );
28 1 return bless {@_}, $self;
29 }
30  
31 9 1;
32  
33 __END__
« Normal/Config.pm ↑ Summary Normal/Config/States.pm »