Data/Parser/Table.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 97.2% 35 / 36 CC 2 SCAR 2.2
CC
2
Cov
100%
get_value
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Data/Object/Category.pm ↑ Summary Data/Parser/JSON.pm »
1 package Feed::Data::Parser::Table;
2  
3 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends 'Feed::Data::Parser::Base';
5 1 ▶use Compiled::Params::OO qw/cpo/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Types::Standard qw/Object HashRef Str/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use HTML::TableContent;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $validate;
10 BEGIN {
11 1 ▶ $validate = cpo(
Subroutine BEGIN: called CC=1 SCAR=0.0
12 get_value => [Object, HashRef, Str],
13 );
14 }
15  
16 has '+parser' => (
17 default => sub {
18 1 ▶ my $self = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
19 1 my $content = $self->content_ref;
20 1 my $t = HTML::TableContent->new();
21 1 $t->parse($$content);
22 1 return { items => $t->get_first_table->aoh };
23 },
24 1 );
25  
26 sub get_value {
27 22 ▶ my ($self, $item, $action) = $validate->get_value->(@_);
Subroutine get_value: called CC=2 SCAR=6.9
Pod undocumented
28 22 my $value = $item->{$action};
29 22 ▶ return $value // '';
Condition100%2/2
$value // ""
l!l
1012
MC/DC100%1/1
$value // ""
$value
Truth table100%2/2
A
A= $value
Aresult
11
00
30 }
31  
32 1 1; # End of Feed::Data
« Data/Object/Category.pm ↑ Summary Data/Parser/JSON.pm »