Timeline/Formatter/HTML.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 63.8% 23 / 36 CC 4 SCAR 22.5
CC
4
Cov
59%
format
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« Timeline/Formatter/SimpleTable.pm ↑ Summary Timeline.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Timeline::Formatter::HTML;
6 1 our $VERSION = '1.100860';
7 # ABSTRACT: Print time line entry types side-by-side in an HTML table
8 1 ▶use HTML::Table;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use parent qw(Data::Timeline::Formatter);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 __PACKAGE__->mk_array_accessors(qw(columns));
11  
12 0 ▶sub format {
Subroutine format: not called CC=4 SCAR=30.0
Pod documented
13 0 my ($self, $timeline) = @_;
14 0 my $table = HTML::Table->new(-head => [ 'timestamp', $self->columns ],);
15 0 for my $entry ($timeline->entries) {
16 0 my @row = (sprintf "%s" => $entry->timestamp);
17 0 for my $col_type ($self->columns) {
18 0 ▶ if ($entry->type eq $col_type) {
Branch: 1 branch
BranchTrueFalseTotal
if ($entry->type eq $col_type) { } 0 0 0
19 0 push @row => $entry->description;
20 } else {
21 0 push @row => '';
22 }
23 }
24 0 $table->addRow(@row);
25 }
26 0 $table->print;
27 }
28 1 1;
29  
30  
31 __END__
« Timeline/Formatter/SimpleTable.pm ↑ Summary Timeline.pm »