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

filter: Statementstmt 50.0% 21 / 42 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 63.6% 7 / 11 Podpod 100% 2 / 2 totaltotal 46.8% 30 / 64 CC 6 SCAR 17.6
CC
6
Cov
42%
init
12.0
__ANON__
12.0
__ANON__
6.0
CRAP 5.8
« lib/HTML/Object/DOM/File.pm ↑ Summary lib/HTML/Object/Number.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/Template.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/01/09
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::Template;
15 BEGIN
16 {
17 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 our $VERSION = 'v0.2.0';
23 };
24  
25 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 sub init
29 {
30 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=3 SCAR=24.8
Pod documented
31 0 $self->{_init_strict_use_sub} = 1;
32 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
33 0 ▶ $self->{tag} = 'template' if( !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless length qq[$self->{"tag"}] 0 0 0
34 0 return( $self );
35 }
36  
37 # Note: property content read-only
38 sub content : lvalue { return( shift->_lvalue({
39 set => sub
40 {
41 0 ▶ my $self = shift( @_ );
Subroutine __ANON__: not called CC=3 SCAR=24.8
42 0 my $ref = shift( @_ );
43 0 ▶ my $nodes = $self->_list_to_nodes( @$ref ) ||
Condition0%0/2
$self->_list_to_nodes(@$ref) || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->_list_to_nodes(@$ref) || (return $self->pass_error)
$self->_list_to_nodes(@$ref)
Truth table0%0/2
A
A= $self->_list_to_nodes(@$ref)
Aresult
11
00
44 return( $self->pass_error );
45 0 for( @$nodes )
46 {
47 0 $_->detach;
48 0 $_->parent( $self );
49 }
50 0 my $children = $self->children;
51 0 $children->set( $nodes );
52 0 return( $self );
53 },
54 get => sub
55 {
56 0 ▶ my $self = shift( @_ );
Subroutine __ANON__: not called CC=2 SCAR=17.9
57 0 ▶ $self->_load_class( 'HTML::Object::DOM::DocumentFragment' ) ||
Branch: 1 branch
BranchTrueFalseTotal
$self->_load_class("HTML::Object::DOM::DocumentFragment") or return $self->pass_error 0 0 0
58 return( $self->pass_error );
59 0 my $children = $self->children;
60 0 my $frag = HTML::Object::DOM::DocumentFragment->new;
61 0 $frag->children->set( $children );
62 0 return( $frag );
63 }
64 0 ▶}, @_ ) ); }
Subroutine content: not called CC=1 SCAR=6.9
Pod documented
65  
66 1 1;
67 # NOTE: POD
68 __END__
« lib/HTML/Object/DOM/File.pm ↑ Summary lib/HTML/Object/Number.pm »