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 144 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 144 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 144 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 144 our $VERSION = '0.02';
9 144 our $AUTHORITY = 'cpan:BRICKPOOL';
10
11 144 ▶use Hash::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 144 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
13 144 ▶use UNIVERSAL::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
14
15 144 ▶BEGIN { require Devel::GlobalDestruction unless $] >= 5.014 }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
unless $] >= "5.014" 0 144 144
16 144 ▶BEGIN { $] >= 5.010 ? require mro : require MRO::Compat }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
$] >= 5.01 ? : 144 0 144
17
18 144 our @ISA;
19 144 ▶BEGIN { @ISA = ( 'UNIVERSAL::Object' ) }
Subroutine BEGIN: called CC=1 SCAR=0.0
20
21 57 ▶sub DESTROY {
Subroutine DESTROY: called CC=5 SCAR=16.2
22 57 my $self = shift;
23 57 ▶ my $class = ref $self || return;
Condition50%1/2
ref $self || (return)
l!l
570
MC/DC0%0/1
ref $self || (return)
ref $self
Truth table50%1/2
A
A= ref $self
Aresult
11
00
24
25 57 my $repr = Scalar::Util::reftype $self;
26 57 ▶ if ( $repr eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($repr eq "HASH") 57 0 57
27 57 Hash::Util::unlock_keys( %$self );
28 }
29
30 57 ▶ my $in_global_destruction = defined ${^GLOBAL_PHASE}
Branch: 1 branch
BranchTrueFalseTotal
defined ${^GLOBAL_PHASE} ? : 57 0 57
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 144 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
37 map {
38 242 my $demolish = *{ $_ . '::DEMOLISH' }{CODE};
39 242 ▶ $demolish->( $self, $in_global_destruction ) if $demolish;
Branch: 1 branch
BranchTrueFalseTotal
if $demolish 36 206 242
40 57 } @{ mro::get_linear_isa( $class ) };
41 }
42 57 return;
43 }
44
45 144 1
46
47 __END__
« lib/TUI/Objects/Rect.pm ↑ Summary lib/TUI/Objects/Streamable.pm »