lib/HTML/Object/DOM/Element/TableCell.pm

filter: Statementstmt 59.6% 37 / 62 Branchbran 25.0% 2 / 8 Conditioncond 28.5% 2 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 41.3% 12 / 29 Podpod 100% 20 / 20 totaltotal 56.1% 73 / 130 CC 8 SCAR 11.8
CC
8
Cov
53%
headers
12.0
init
6.3
__ANON__
6.0
CRAP 3.3
« lib/HTML/Object/DOM/Element/IFrame.pm ↑ Summary lib/HTML/Object/XPath/Literal.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableCell.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/01/07
7 ## Modified 2022/09/18
8 ## All rights reserved.
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::Element::TableCell;
15 BEGIN
16 {
17 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use HTML::Object::DOM::Element::Shared qw( :tablecell );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 our $VERSION = 'v0.2.0';
24 };
25  
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 12 ▶ my $self = shift( @_ );
Subroutine init: called CC=4 SCAR=18.5
Pod documented
32 # Could be also <th>
33 12 ▶ $self->{tag} = 'td' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"tag"} and length qq[$self->{"tag"}] 12 0 12
Condition33%1/3
defined $self->{"tag"} and length qq[$self->{"tag"}]
!ll&&!rl&&r
1200
MC/DC0%0/2
defined $self->{"tag"} and length qq[$self->{"tag"}]
defined $self->{"tag"} length qq[$self->{"tag"}]
Truth table33%1/3
A and B
A= defined $self->{"tag"}B= length qq[$self->{"tag"}]
ABresult
0X0
100
111
34 12 $self->{_init_strict_use_sub} = 1;
35 12 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 12 12
36 $self->_set_get_internal_attribute_callback( headers => sub
37 {
38 0 ▶ my( $this, $val ) = @_;
Subroutine __ANON__: not called CC=2 SCAR=17.9
39 0 my $list;
40 0 ▶ return if( !( $list = $this->{_headers_list} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $list = $this->{"_headers_list"} 0 0 0
41 # $list->debug( $self->debug );
42 0 $list->update( $val );
43 12 });
44 12 return( $self );
45 }
46  
47 # Note: property abbr
48 0 ▶sub abbr : lvalue { return( shift->_set_get_property( 'abbr', @_ ) ); }
Subroutine abbr: not called CC=1 SCAR=6.9
Pod documented
49  
50 # Note: deprecated property align is inherited
51  
52 # Note: deprecated property axis
53 0 ▶sub axis : lvalue { return( shift->_set_get_property( 'axis', @_ ) ); }
Subroutine axis: not called CC=1 SCAR=6.9
Pod documented
54  
55 # Note: deprecated property bgColor
56 0 ▶sub bgColor : lvalue { return( shift->_set_get_property( 'bgcolor', @_ ) ); }
Subroutine bgColor: not called CC=1 SCAR=6.9
Pod documented
57  
58 0 ▶sub bgcolor : lvalue { return( shift->bgColor( @_ ) ); }
Subroutine bgcolor: not called CC=1 SCAR=6.9
Pod documented
59  
60 # Note: property cellIndex read-only
61 sub cellIndex
62 {
63 1 ▶ my $self = shift( @_ );
Subroutine cellIndex: called CC=2 SCAR=7.0
Pod documented
64 1 ▶ my $parent = $self->parent || return;
Condition50%1/2
$self->parent || (return)
l!l
10
MC/DC0%0/1
$self->parent || (return)
$self->parent
Truth table50%1/2
A
A= $self->parent
Aresult
11
00
65 1 my $siblings = $parent->children;
66 1 my $pos = $siblings->pos( $self );
67 1 return( $pos );
68 }
69  
70 # Note: deprecated property ch
71 0 ▶sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); }
Subroutine ch: not called CC=1 SCAR=6.9
Pod documented
72  
73 # Note: deprecated property chOff
74 0 ▶sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); }
Subroutine chOff: not called CC=1 SCAR=6.9
Pod documented
75  
76 0 ▶sub choff : lvalue { return( shift->chOff( @_ ) ); }
Subroutine choff: not called CC=1 SCAR=6.9
Pod documented
77  
78 # Note: property colSpan
79 0 ▶sub colSpan : lvalue { return( shift->_set_get_property( 'colspan', @_ ) ); }
Subroutine colSpan: not called CC=1 SCAR=6.9
Pod documented
80  
81 0 ▶sub colspan : lvalue { return( shift->colSpan( @_ ) ); }
Subroutine colspan: not called CC=1 SCAR=6.9
Pod documented
82  
83 # Note: property colgroup
84 0 ▶sub colgroup : lvalue { return( shift->_set_get_property( 'colgroup', @_ ) ); }
Subroutine colgroup: not called CC=1 SCAR=6.9
Pod documented
85  
86 # Note: property headers read-only
87 sub headers
88 {
89 0 ▶ my $self = shift( @_ );
Subroutine headers: not called CC=3 SCAR=24.8
Pod documented
90 0 ▶ unless( $self->{_headers_list} )
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_headers_list"}) 0 0 0
91 {
92 0 my $headers = $self->attr( 'headers' );
93 0 require HTML::Object::TokenList;
94 0 ▶ $self->{_headers_list} = HTML::Object::TokenList->new( $headers, element => $self, attribute => 'headers', debug => $self->debug ) ||
Condition0%0/2
'HTML::Object::TokenList'->new($headers, 'element', $self, 'attribute', 'headers', 'debug', $self->debug) || (return $self->pass_error('HTML::Object::TokenList'->error))
l!l
00
MC/DC0%0/1
'HTML::Object::TokenList'->new($headers, 'element', $self, 'attribute', 'headers', 'debug', $self->debug) || (return $self->pass_error('HTML::Object::TokenList'->error))
'HTML::Object::TokenList'->new($headers, 'element', $self, 'attribute', 'headers', 'debug', $self->debug)
Truth table0%0/2
A
A= 'HTML::Object::TokenList'->new($headers, 'element', $self, 'attribute', 'headers', 'debug', $self->debug)
Aresult
11
00
95 return( $self->pass_error( HTML::Object::TokenList->error ) );
96 }
97 0 return( $self->{_headers_list} );
98 }
99  
100 # Note: deprecated property height is inherited
101  
102 # Note: deprecated property noWrap
103 0 ▶sub noWrap : lvalue { return( shift->_set_get_property( 'nowrap', @_ ) ); }
Subroutine noWrap: not called CC=1 SCAR=6.9
Pod documented
104  
105 0 ▶sub nowrap : lvalue { return( shift->noWrap( @_ ) ); }
Subroutine nowrap: not called CC=1 SCAR=6.9
Pod documented
106  
107 # Note: property rowSpan
108 1 ▶sub rowSpan : lvalue { return( shift->_set_get_property( 'rowspan', @_ ) ); }
Subroutine rowSpan: called CC=1 SCAR=0.0
Pod documented
109  
110 1 ▶sub rowspan : lvalue { return( shift->rowSpan( @_ ) ); }
Subroutine rowspan: called CC=1 SCAR=0.0
Pod documented
111  
112 # Note: property scope
113 0 ▶sub scope : lvalue { return( shift->_set_get_property( 'scope', @_ ) ); }
Subroutine scope: not called CC=1 SCAR=6.9
Pod documented
114  
115 # Note: deprecated property vAlign
116 0 ▶sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); }
Subroutine vAlign: not called CC=1 SCAR=6.9
Pod documented
117  
118 0 ▶sub valign : lvalue { return( shift->vAlign( @_ ) ); }
Subroutine valign: not called CC=1 SCAR=6.9
Pod documented
119  
120 # Note: deprecated property width is inherited
121  
122 2 1;
123 # NOTE: POD
124 __END__
« lib/HTML/Object/DOM/Element/IFrame.pm ↑ Summary lib/HTML/Object/XPath/Literal.pm »