Object/Comment.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 95.6% 44 / 46 CC 3 SCAR 4.4
CC
3
Cov
97%
init
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« Object/Selector.pm ↑ Summary Object/Rule/At.pm »
1 ##----------------------------------------------------------------------------
2 ## CSS Object Oriented - ~/lib/CSS/Object/Comment.pm
3 ## Version v0.1.0
4 ## Copyright(c) 2020 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <@sitael.local>
6 ## Created 2020/06/21
7 ## Modified 2020/06/21
8 ##
9 ##----------------------------------------------------------------------------
10 package CSS::Object::Comment;
11 BEGIN
12 {
13 6 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶ use parent qw( CSS::Object::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶ use Devel::Confess;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 use overload (
18 6 '""' => 'as_string',
19 fallback => 1,
20 6 ▶ );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 6 ▶ our $VERSION = 'v0.1.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
22 };
23  
24 sub init
25 {
26 8 ▶ my $self = shift( @_ );
Subroutine init: called CC=3 SCAR=11.0
Pod documented
27 8 my $this = shift( @_ );
28 8 ▶ if( CORE::length( $this ) && $self->_is_array( $this ) )
Branch: 1 branch
BranchTrueFalseTotal
if (length $this and $self->_is_array($this)) { } 5 3 8
Condition66%2/3
length $this and $self->_is_array($this)
!ll&&!rl&&r
035
MC/DC50%1/2
length $this and $self->_is_array($this)
length $this $self->_is_array($this)
Truth table66%2/3
A and B
A= length $thisB= $self->_is_array($this)
ABresult
0X0
100
111
29 {
30 5 $self->values->push( @$this );
31 }
32 else
33 {
34 3 $self->values->push( $this );
35 }
36 8 $self->SUPER::init( @_ );
37 8 return( $self );
38 }
39  
40 sub as_string
41 {
42 52 ▶ my $self = shift( @_ );
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
43 52 return( $self->format->comment_as_string( $self ) );
44 }
45  
46 60 ▶sub values { return( shift->_set_get_object_array_object( 'values', 'CSS::Object::Value', @_ ) ); }
Subroutine values: called CC=1 SCAR=0.0
Pod documented
47  
48 6 1;
49  
50 __END__
« Object/Selector.pm ↑ Summary Object/Rule/At.pm »