| 1 | package Data::Range::Compare::Stream::Iterator::Compare::Base; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 6 | ▶ | use Data::Range::Compare::Stream::Iterator::Compare::Result; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 6 | ▶ | use constant RESULT_CLASS=>'Data::Range::Compare::Stream::Iterator::Compare::Result'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 6 | ▶ | use base qw(Data::Range::Compare::Stream::Iterator::Base); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 46 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 46 | my ($class,%args)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 46 | $class->SUPER::new(column_map=>[],root_ids=>[],dead_columns=>[],last_row=>0,iterators_empty=>0,prepared=>0,consolidateors=>[],raw_row=>[],%args); | |||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 46 | ▶ | sub on_dead_iterator { 1 } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on_dead_iterator: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 691 | ▶ | sub prepared { $_[0]->{prepared} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepared: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 96 | ▶ | sub add_consolidator { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_consolidator: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 96 | my ($self,$consolidator)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 96 | ▶ | croak "Fatal error, cannot add new objects once the consolidator has been called!!" if $self->prepared; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 96 | push @{$self->{consolidateors}},$consolidator; | |||||||||||||||||||||||||||||||||||||||||
| 26 | 96 | my $id=$#{$self->{consolidateors}}; | |||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | 96 | $consolidator->set_column_id($id); | |||||||||||||||||||||||||||||||||||||||||
| 29 | 96 | return $id | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 28 | ▶ | sub insert_consolidator { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
insert_consolidator: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 28 | my ($self,$consolidator)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 28 | push @{$self->{consolidateors}},$consolidator; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 28 | my $id=$#{$self->{consolidateors}}; | |||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 28 | $consolidator->set_column_id($id); | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 28 | ▶ | if($self->prepared) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 8 | ▶ | croak "cannot insert empty consolidators!" unless $consolidator->has_next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 8 | $self->{raw_row}->[$id]=$consolidator->get_next; | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | 28 | return $id; | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | 82 | ▶ | sub get_iterator_by_id { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_iterator_by_id: called CC=4 SCAR=16.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 82 | my ($self,$id)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 82 | ▶ | croak "id out of bounds" if !defined($id) or $id>$#{$_[0]->{consolidateors}} or $id<0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
not defined $id or $id > $#{$_[0]{"consolidateors"};} or $id < 0
not defined $id or $id > $#{$_[0]{"consolidateors"};}
MC/DC0%0/3
not defined $id or $id > $#{$_[0]{"consolidateors"};} or $id < 0
not defined $id
$id > $#{$_[0]{"consolidateors"};}
$id < 0
Truth table25%1/4
not(A) or B or C
A= not defined $idB= $id > $#{$_[0]{"consolidateors"};}C= $id < 0
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | 82 | return $self->{consolidateors}->[$id]; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | 1527 | ▶ | sub get_column_count_human_readable { 1 + $_[0]->get_column_count} | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_column_count_human_readable: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | 1587 | ▶ | sub get_column_count { $#{$_[0]->{consolidateors}} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_column_count: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub get_consolidateors { @{$_[0]->{consolidateors}} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_consolidateors: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 308 | ▶ | sub get_current_row { $_[0]->{current_row} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_current_row: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 6 | ▶ | sub iterators_empty { $_[0]->{iterators_empty} } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
iterators_empty: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||