| 1 | package IBGE::Municipios; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | our $VERSION = 0.02; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | my %code_for_data = _init(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | sub codigo { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
codigo: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 5 | my ($city, $state) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | return ( $city | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | && $state | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | && exists $code_for_data{$state} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | && exists $code_for_data{$state}{$city} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | ? $code_for_data{$state}{$city} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$city and $state and exists $code_for_data{$state} and exists $code_for_data{$state}{$city}
$city and $state and exists $code_for_data{$state}
$city and $state
MC/DC75%3/4
$city and $state and exists $code_for_data{$state} and exists $code_for_data{$state}{$city}
$city
$state
exists $code_for_data{$state}
exists $code_for_data{$state}{$city}
Truth table80%4/5
A and B and C and D
A= $cityB= $stateC= exists $code_for_data{$state}D= exists $code_for_data{$state}{$city}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | : undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | ▶ | sub _init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_init: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | my %codes = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | while (my $line = <DATA>) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 11238 | my ($state, $code, $city) = split /,/ => $line; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 11238 | ▶ | chomp $city if defined $city; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 11238 | ▶ | next unless $state && $code && $city; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$state and $code and $city
$state and $code
MC/DC66%2/3
$state and $code and $city
$state
$code
$city
Truth table75%3/4
A and B and C
A= $stateB= $codeC= $city
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 11142 | $codes{$state}{$city} = $code; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 2 | return %codes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | __DATA__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||