Tabular/Row/Header.pm

filter: Statementstmt 75.0% 27 / 36 Branchbran 37.5% 3 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 9 / 12 Podpod 0.0% 0 / 8 totaltotal 60.9% 39 / 64 CC 5 SCAR 7.6
CC
5
Cov
68%
cell_html_attributes
6.0
hdr
2.1
colspan
2.0
CRAP 2.1
« Tabular/Output.pm ↑ Summary Tabular/Formula.pm »
1 # Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 package
5 Data::Tabular::Row::Header;
6  
7 5 ▶use base 'Data::Tabular::Row';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use overload '@{}' => \&array,
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 '""' => \&str;
13  
14 sub str
15 0 ▶{
Subroutine str: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $self = shift;
17 0 __PACKAGE__;
18 }
19  
20 sub headers
21 80 ▶{
Subroutine headers: called CC=1 SCAR=0.0
Pod undocumented
22 80 my $self = shift;
23 80 qw ( _header );
24 }
25  
26 sub colspan
27 80 ▶{
Subroutine colspan: called CC=2 SCAR=7.0
Pod undocumented
28 80 my $self = shift;
29 80 my $header = shift;
30 80 ▶ die 'unknown column ' . $header unless $header eq '_header';
Branch: 1 branch
BranchTrueFalseTotal
unless $header eq "_header" 0 80 80
31  
32 80 scalar($self->output->headers);
33 }
34  
35 sub table
36 240 ▶{
Subroutine table: called CC=1 SCAR=0.0
Pod undocumented
37 240 my $self = shift;
38 240 $self->{table};
39 }
40  
41 sub get_column
42 80 ▶{
Subroutine get_column: called CC=2 SCAR=7.0
Pod undocumented
43 80 my $self = shift;
44 80 my $column_name = shift;
45 80 ▶ die 'unknown column ' . $column_name unless $column_name eq '_header';
Branch: 1 branch
BranchTrueFalseTotal
unless $column_name eq "_header" 0 80 80
46  
47 Data::Tabular::Type::Text->new(
48 data => $self->{text},
49 80 type => 'header',
50 );
51 }
52  
53 sub hdr
54 17 ▶{
Subroutine hdr: called CC=2 SCAR=7.2
Pod undocumented
55 17 my $self = shift;
56 17 ▶ defined $self->{header} ? $self->{header} : 1;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'header'} ? : 0 17 17
57 }
58  
59 sub cell_html_attributes
60 0 ▶{
Subroutine cell_html_attributes: not called CC=2 SCAR=17.9
Pod undocumented
61 0 my $self = shift;
62 0 my $cell = shift;
63 0 my $column_name = $cell->name();
64 0 ▶ die 'unknown column ' . $column_name unless $column_name eq '_header';
Branch: 1 branch
BranchTrueFalseTotal
unless $column_name eq "_header" 0 0 0
65 0 my $span = $self->output->headers;
66 {
67 0 align => 'left',
68 colspan => $span,
69 };
70 }
71  
72 sub type
73 0 ▶{
Subroutine type: not called CC=1 SCAR=6.9
Pod undocumented
74 0 'header';
75 }
76  
77 5 1;
78 __END__
« Tabular/Output.pm ↑ Summary Tabular/Formula.pm »