lib/TUI/toolkit/UO/Base.pm

filter: Statementstmt 100% 40 / 40 Branchbran 60.0% 6 / 10 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 11 / 11 Podpod n/a totaltotal 90.6% 58 / 64 CC 7 SCAR 9.0
CC
7
Cov
90%
DESTROY
5.0
BEGIN
2.1
BEGIN
2.1
CRAP 2.5
« lib/TUI/Objects/Rect.pm ↑ Summary lib/TUI/Objects/Streamable.pm »
1 package TUI::toolkit::UO::Base;
2 # ABSTRACT: Derived UNIVERSAL::Object class for TUI::toolkit
3
4 161 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 161 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 161 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 161 our $VERSION = '0.02';
9 161 our $AUTHORITY = 'cpan:BRICKPOOL';
10
11 161 ▶use Hash::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 161 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13 161 ▶use UNIVERSAL::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
14
15 161 ▶BEGIN { require Devel::GlobalDestruction unless $] >= 5.014 }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
unless $] >= "5.014" 0 161 161
16 161 ▶BEGIN { $] >= 5.010 ? require mro : require MRO::Compat }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$] >= 5.01 ? : 161 0 161
17
18 161 our @ISA;
19 161 ▶BEGIN { @ISA = ( 'UNIVERSAL::Object' ) }
Subroutine BEGIN: called CC=1 SCAR=0.0
20
21 79 ▶sub DESTROY {
Subroutine DESTROY: called CC=5 SCAR=16.2
22 79 my $self = shift;
23 79 ▶ my $class = ref $self || return;
Condition50%1/2
ref $self || (return)
l!l
790
MC/DC0%0/1
ref $self || (return)
ref $self
Truth table50%1/2
A
A= ref $self
Aresult
11
00
24
25 79 my $repr = Scalar::Util::reftype $self;
26 79 ▶ if ( $repr eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($repr eq "HASH") 79 0 79
27 79 Hash::Util::unlock_keys( %$self );
28 }
29
30 79 ▶ my $in_global_destruction = defined ${^GLOBAL_PHASE}
Branch: 1 branch
BranchTrueFalseTotal
defined ${^GLOBAL_PHASE} ? : 79 0 79
31 ? ${^GLOBAL_PHASE} eq 'DESTRUCT'
32 : Devel::GlobalDestruction::in_global_destruction();
33
34 # Call all DEMOLISH methods starting with the derived classes.
35 DEMOLISHALL: {
36 161 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
37 map {
38 348 my $demolish = *{ $_ . '::DEMOLISH' }{CODE};
39 348 ▶ $demolish->( $self, $in_global_destruction ) if $demolish;
Branch: 1 branch
BranchTrueFalseTotal
if $demolish 54 294 348
40 79 } @{ mro::get_linear_isa( $class ) };
41 }
42 79 return;
43 }
44
45 161 1
46
47 __END__
« lib/TUI/Objects/Rect.pm ↑ Summary lib/TUI/Objects/Streamable.pm »