| 1 | package Test::MasterData::Declare::Runner; | ||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use 5.010001; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 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 | 4 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Class::Accessor::Lite ( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 4 | new => 1, | |||||||||||||||||||||||||||
| 9 | rw => [qw/bucket/], | ||||||||||||||||||||||||||||
| 10 | ro => [qw/code/], | ||||||||||||||||||||||||||||
| 11 | 4 | ); | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Carp qw/croak/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 3 | ▶ | sub run { | ||||||||||||||||||||||||||
|
Subroutine
run: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 3 | my $self = shift; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 3 | $self->code->(); | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 5 | ▶ | sub add_reader_to_bucket { | ||||||||||||||||||||||||||
|
Subroutine
add_reader_to_bucket: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 22 | 5 | my ($self, $reader) = @_; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 5 | ▶ | $self->bucket({}) unless $self->bucket; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | # TODO: merge reader | ||||||||||||||||||||||||||||
| 27 | 5 | $self->bucket->{$reader->table_name} = $reader; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 7 | ▶ | sub rows { | ||||||||||||||||||||||||||
|
Subroutine
rows: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 31 | 7 | my ($self, $table_name) = @_; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 7 | ▶ | if (!defined $self->bucket || !exists $self->bucket->{$table_name}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $self->bucket and exists $self->bucket->{$table_name}
MC/DC0%0/2
defined $self->bucket and exists $self->bucket->{$table_name}
defined $self->bucket
exists $self->bucket->{$table_name}
Truth table33%1/3
A and B
A= defined $self->bucketB= exists $self->bucket->{$table_name}
| |||||||||||||||||||||||||||||
| 34 | 0 | croak "$table_name is not exists."; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | 7 | my $reader = $self->bucket->{$table_name}; | |||||||||||||||||||||||||||
| 37 | 7 | my $rows = $reader->rows; | |||||||||||||||||||||||||||
| 38 | 7 | return $rows; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 4 | 1; | |||||||||||||||||||||||||||