| 1 | package Ftree::DataParsers::ArrayImporters::CSVArrayImporter; | ||||||||||||||||||||||||||||
| 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 | 2 | ▶ | use version; our $VERSION = qv('2.3.41'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Params::Validate qw(:all); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | # use CGI::Carp qw(fatalsToBrowser); | ||||||||||||||||||||||||||||
| 7 | 2 | my $fh; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 0 | my ($classname, $file_name, $encoding) = @_; | |||||||||||||||||||||||||||
| 11 | 0 | my $self = { | |||||||||||||||||||||||||||
| 12 | current_line => undef, | ||||||||||||||||||||||||||||
| 13 | }; | ||||||||||||||||||||||||||||
| 14 | 0 | ▶ | open $fh, "<:encoding($encoding)", "$file_name" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | or die "Unable to open datafile $file_name"; | ||||||||||||||||||||||||||||
| 16 | 0 | $self->{current_line} = <$fh>; | |||||||||||||||||||||||||||
| 17 | 0 | return bless $self, $classname; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub hasNext { | ||||||||||||||||||||||||||
|
Subroutine
hasNext: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 0 | my ($self) = validate_pos(@_, {type => HASHREF}); | |||||||||||||||||||||||||||
| 21 | 0 | return $self->{current_line}; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub next { | ||||||||||||||||||||||||||
|
Subroutine
next: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 0 | my ($self) = validate_pos(@_, {type => HASHREF}); | |||||||||||||||||||||||||||
| 25 | 0 | my $prevline = $self->{current_line}; | |||||||||||||||||||||||||||
| 26 | do { | ||||||||||||||||||||||||||||
| 27 | 0 | $self->{current_line} = <$fh>; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | 0 | ▶ | while($self->{current_line} && $self->{current_line} =~ m/^\s*\#/x); # skip comments | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"current_line"} and $self->{"current_line"} =~ /^\s*\#/x
MC/DC0%0/2
$self->{"current_line"} and $self->{"current_line"} =~ /^\s*\#/x
$self->{"current_line"}
$self->{"current_line"} =~ /^\s*\#/x
Truth table0%0/3
A and B
A= $self->{"current_line"}B= $self->{"current_line"} =~ /^\s*\#/x
| |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | chomp($prevline); | |||||||||||||||||||||||||||
| 33 | 0 | return split( /;/, $prevline); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub close { | ||||||||||||||||||||||||||
|
Subroutine
close: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | 0 | my ($self) = validate_pos(@_, {type => HASHREF}); | |||||||||||||||||||||||||||
| 37 | 0 | ▶ | close($fh) or die "Unable to close datafile"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 2 | 1; | |||||||||||||||||||||||||||