| 1 | package String::Normal::Config; | ||||||||||||||||||||
| 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 | |||||||||||||||||||||
| 5 | 9 | ▶ | use String::Normal::Config::BusinessStem; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 9 | ▶ | use String::Normal::Config::BusinessStop; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 9 | ▶ | use String::Normal::Config::BusinessCompress; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 9 | ▶ | use String::Normal::Config::AddressStem; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 9 | ▶ | use String::Normal::Config::AddressStop; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 9 | ▶ | use String::Normal::Config::States; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 9 | ▶ | use String::Normal::Config::AreaCodes; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 9 | ▶ | use String::Normal::Config::TitleStem; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 9 | ▶ | use String::Normal::Config::TitleStop; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 14 | ▶ | sub _slurp { | ||||||||||||||||||
|
Subroutine
_slurp: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 16 | 14 | my $fh = shift; | |||||||||||||||||||
| 17 | 14 | my @data = (); | |||||||||||||||||||
| 18 | 14 | ▶ | chomp( @data = map { $_ || () } map { split /\s+/, $_, 2 } <$fh> ); | ||||||||||||||||||
|
Condition66%2/3
$_ || ()
MC/DC50%1/2
$_ || ()
$_
()
Truth table66%2/3
A || B
A= $_B= ()
| |||||||||||||||||||||
| 19 | 14 | close $fh; | |||||||||||||||||||
| 20 | 14 | return @data; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 3 | ▶ | sub _expand_ranges { | ||||||||||||||||||
|
Subroutine
_expand_ranges: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 24 | 3 | my @expanded = (); | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 3 | for my $line (@_) { | |||||||||||||||||||
| 27 | 625 | my @ranges = map { /(\w)-?(\w)/;[$1..$2] } $line =~ /\[(\w-?\w)+\]/g; | |||||||||||||||||||
| 28 | 625 | $line =~ s/\[.*//; | |||||||||||||||||||
| 29 | 625 | _expand( \my @results, $line, @ranges ); | |||||||||||||||||||
| 30 | 625 | push @expanded, @results; | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 3 | return @expanded; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 1133 | ▶ | sub _expand { | ||||||||||||||||||
|
Subroutine
_expand: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 37 | 1133 | my ($results,$str,$car,@cdr) = @_; | |||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1133 | ▶ | if (ref $car ne 'ARRAY') { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 40 | 1101 | push @$results, $str; | |||||||||||||||||||
| 41 | 1101 | return; | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 32 | for (@$car) { | |||||||||||||||||||
| 45 | 508 | _expand( $results, $str . $_, @cdr ); | |||||||||||||||||||
| 46 | }; | ||||||||||||||||||||
| 47 | } | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 3338 | ▶ | sub _attach { | ||||||||||||||||||
|
Subroutine
_attach: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 50 | 3338 | my ($t, $car, @cdr) = @_; | |||||||||||||||||||
| 51 | 3338 | ▶ | return unless defined $car; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | 2237 | ▶ | $t->{$car} = {} unless ref $t->{$car}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 53 | 2237 | _attach( $t->{$car}, @cdr ); | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 9 | 1; | |||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||