NASA_Ames/FFI1010.pm

filter: Statementstmt 89.1% 41 / 46 Branchbran 57.1% 8 / 14 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 75.3% 58 / 77 CC 10 SCAR 16.6
CC
10
Cov
77%
_refillBuffer
8.2
new
4.4
BEGIN
1.0
CRAP 5.3
« NASA_Ames/DataEntry.pm ↑ Summary NASA_Ames.pm »
1 package Text::NASA_Ames::FFI1010;
2 1 ▶use base qw(Text::NASA_Ames);
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use 5.00600;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf " %d." . "%02d" x $#r, @r };
9  
10  
11 =head1 NAME
12  
13 Text::NASA_Ames::FFI1010 - Implementation of FFI1010 NASA_Ames format
14  
15 =head1 SYNOPSIS
16  
17  
18 =head1 DESCRIPTION
19  
20 This class should normally not be called directly but through the
21 L<Text::NASA_Ames> class indirectly.
22  
23 =head1 PUBLIC METHODS
24  
25 =over 4
26  
27 =item new (Text::NASA_Ames-object || options for new NASA_Ames)
28  
29 parses the (rest of the) header (body and comments)
30  
31 =cut
32  
33 2 ▶sub new {
Subroutine new: called CC=4 SCAR=14.9
Pod documented
34 2 my ($class, $fileObj) = @_;
35 2 ▶ $class = ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
36 2 ▶ if (! (ref $fileObj && (ref($fileObj) eq 'Text::NASA_Ames'))) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $fileObj and ref $fileObj eq "Text::NASA_Ames") 0 2 2
Condition33%1/3
ref $fileObj and ref $fileObj eq "Text::NASA_Ames"
!ll&&!rl&&r
002
MC/DC0%0/2
ref $fileObj and ref $fileObj eq "Text::NASA_Ames"
ref $fileObj ref $fileObj eq "Text::NASA_Ames"
Truth table33%1/3
A and B
A= ref $fileObjB= ref $fileObj eq "Text::NASA_Ames"
ABresult
0X0
100
111
37 0 return new Text::NASA_Ames($fileObj);
38 }
39 2 my $self = $fileObj;
40 2 bless $self, $class;
41  
42 2 $self->_parseList('dX', $self->nIV);
43 2 $self->_parseLines('xName', $self->nIV);
44 2 $self->_parseVDeclaration;
45 2 $self->_parseAuxDeclaration;
46 2 $self->_parseTailHeader;
47  
48 2 return $self;
49 }
50  
51 20 ▶sub _refillBuffer {
Subroutine _refillBuffer: called CC=7 SCAR=21.0
52 20 my $self = shift;
53  
54 20 my $line = $self->nextLine;
55 20 ▶ return unless defined $line;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $line 1 19 20
56  
57 19 my ($x, @a) = split ' ', $line;
58 19 ▶ if (@a != $self->nAuxV) {
Branch: 1 branch
BranchTrueFalseTotal
if (@a != $self->nAuxV) 0 19 19
59 0 $self->_carp("not enough elements for Aux, expected ".
60 $self->nAuxV() . ", got ". scalar @a);
61 0 return;
62 }
63 19 ▶ $self->_cleanAndScaleVals($self->aMiss, $self->aScal, \@a)
Branch: 1 branch
BranchTrueFalseTotal
if $self->nAuxV > 0 19 0 19
64 if $self->nAuxV > 0;
65  
66 19 my @v;
67 19 ▶ if ($self->nV > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->nV > 0) 19 0 19
68 19 $line = $self->nextLine;
69 19 ▶ return unless defined $line;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $line 0 19 19
70 19 @v = split ' ', $line;
71 19 ▶ if (@v != $self->nV) {
Branch: 1 branch
BranchTrueFalseTotal
if (@v != $self->nV) 0 19 19
72 0 $self->_carp("not enough elements for V, expected ".
73 $self->nV() . ", got ". scalar @v);
74 0 return;
75 }
76 19 $self->_cleanAndScaleVals($self->vMiss, $self->vScal, \@v);
77 }
78 19 push @{ $self->dataBuffer }, new Text::NASA_Ames::DataEntry({X => [$x],
79 V => \@v,
80 A => \@a});
81 }
82  
83 1 1;
84 __END__
« NASA_Ames/DataEntry.pm ↑ Summary NASA_Ames.pm »