NASA_Ames/FFI1001.pm

filter: Statementstmt 91.6% 33 / 36 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 77.9% 46 / 59 CC 6 SCAR 10.5
CC
6
Cov
81%
new
4.5
_refillBuffer
3.1
BEGIN
1.0
CRAP 2.8
« NASA_Ames.pm ↑ Summary NASA_Ames/FFI2010.pm »
1 package Text::NASA_Ames::FFI1001;
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::FFI1001 - Implementation of FFI1001 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 4 ▶sub new {
Subroutine new: called CC=4 SCAR=15.0
Pod documented
34 4 my ($class, $fileObj) = @_;
35 4 ▶ $class = ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
040
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 4 ▶ if (! (ref $fileObj && (ref($fileObj) eq 'Text::NASA_Ames'))) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $fileObj and ref $fileObj eq "Text::NASA_Ames") 0 4 4
Condition33%1/3
ref $fileObj and ref $fileObj eq "Text::NASA_Ames"
!ll&&!rl&&r
004
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 4 my $self = $fileObj;
40 4 bless $self, $class;
41  
42 4 $self->_parseList('dX', $self->nIV);
43 4 $self->_parseLines('xName', $self->nIV);
44 4 $self->_parseVDeclaration;
45 4 $self->_parseTailHeader;
46  
47 4 return $self;
48 }
49  
50 56 ▶sub _refillBuffer {
Subroutine _refillBuffer: called CC=3 SCAR=11.3
51 56 my $self = shift;
52  
53 56 my $line = $self->nextLine;
54 56 ▶ return unless defined $line;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $line 2 54 56
55  
56 54 my ($x, @v) = split ' ', $line;
57 54 ▶ if (@v != $self->nV) {
Branch: 1 branch
BranchTrueFalseTotal
if (@v != $self->nV) 0 54 54
58 0 $self->_carp("not enough elements for Aux, expected ".
59 $self->nV() . ", got ". scalar @v);
60 0 return;
61 }
62 54 $self->_cleanAndScaleVals($self->vMiss, $self->vScal, \@v);
63 54 push @{ $self->dataBuffer }, new Text::NASA_Ames::DataEntry({X => [$x],
64 V => \@v});
65 }
66  
67 1 1;
68 __END__
« NASA_Ames.pm ↑ Summary NASA_Ames/FFI2010.pm »