Object/Boolean.pm

filter: Statementstmt 63.6% 21 / 33 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 43.7% 7 / 16 Podpod 100% 9 / 9 totaltotal 61.6% 37 / 60 CC 2 SCAR 7.2
CC
2
Cov
60%
to_literal
6.0
getChildNodes
2.0
getAttributes
2.0
CRAP 2.1
« Object/DOM/ValidityState.pm ↑ Summary Object/DOM/VTTRegion.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/Boolean.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/04/22
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::Boolean;
15 BEGIN
16 1 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
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' );
20 1 ▶ use parent qw( Module::Generic::Boolean );
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 0 ▶sub getChildNodes { return( shift->new_array ); }
Subroutine getChildNodes: not called CC=1 SCAR=6.9
Pod documented
29  
30 0 ▶sub getAttributes { return( shift->new_array ); }
Subroutine getAttributes: not called CC=1 SCAR=6.9
Pod documented
31  
32 0 ▶sub False { return( shift->false ); }
Subroutine False: not called CC=1 SCAR=6.9
Pod documented
33  
34 0 ▶sub string_value { return( shift->to_literal->value ); }
Subroutine string_value: not called CC=1 SCAR=6.9
Pod documented
35  
36 0 ▶sub to_boolean { return( $_[0] ); }
Subroutine to_boolean: not called CC=1 SCAR=6.9
Pod documented
37  
38 sub to_literal
39 0 ▶{
Subroutine to_literal: not called CC=2 SCAR=17.9
Pod documented
40 0 require HTML::Object::Literal;
41 0 ▶ return( HTML::Object::Literal->new( shift->value ? 'true' : 'false' ) );
Branch: 1 branch
BranchTrueFalseTotal
(shift())->value ? : 0 0 0
42 }
43  
44 sub to_number
45 0 ▶{
Subroutine to_number: not called CC=1 SCAR=6.9
Pod documented
46 0 require HTML::Object::Number;
47 0 return( HTML::Object::Number->new( shift->value ) );
48 }
49  
50 0 ▶sub True { return( shift->true ); }
Subroutine True: not called CC=1 SCAR=6.9
Pod documented
51  
52 0 ▶sub value { return( ${$_[0]} ); }
Subroutine value: not called CC=1 SCAR=6.9
Pod documented
53  
54 1 1;
55 # NOTE: POD
56 __END__
« Object/DOM/ValidityState.pm ↑ Summary Object/DOM/VTTRegion.pm »