FIT/Simple.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.2% 33 / 35 CC 2 SCAR 2.5
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« FIT.pm ↑ Summary FIT/Profile.pm »
1 package Parser::FIT::Simple;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Parser::FIT;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
9 1 my $class = shift;
10  
11 1 my $self = {};
12  
13 1 bless($self, $class);
14  
15 1 return $self;
16 }
17  
18 1 ▶sub parse {
Subroutine parse: called CC=1 SCAR=0.0
Pod undocumented
19 1 my $self = shift;
20 1 my $file = shift;
21  
22 1 my $result = {};
23  
24 my $parser = Parser::FIT->new(on => {
25 109 ▶ _any => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
26 109 my ($msgType, $msg) = (shift, shift);
27 109 ▶ if(!exists $result->{$msgType}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $result->{$msgType}) 7 102 109
28 7 $result->{$msgType} = [];
29 }
30  
31 109 push(@{$result->{$msgType}}, $msg);
32 }
33 1 });
34  
35 1 $parser->parse($file);
36  
37 1 return $result;
38 }
39  
40 1 1;
41  
42 __END__
« FIT.pm ↑ Summary FIT/Profile.pm »