lib/TUI/Objects/Object.pm

filter: Statementstmt 92.9% 53 / 57 Branchbran 35.7% 5 / 14 Conditioncond 22.2% 2 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 92.8% 13 / 14 Podpod 80.0% 4 / 5 totaltotal 73.3% 77 / 105 CC 13 SCAR 23.2
CC
13
Cov
75%
destroy
21.6
__ANON__
6.0
BUILDARGS
2.0
CRAP 10.2
« lib/TUI/Drivers/Display.pm ↑ Summary lib/TUI/Validate/StringLookupValidator.pm »
1 package TUI::Objects::Object;
2 # ABSTRACT: defines the class TObject
3
4 105 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 105 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 105 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 105 our $VERSION = '2.000002';
9 105 $VERSION =~ tr/_//d;
10 105 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 105 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 105 our @EXPORT = qw(
14 TObject
15 new_TObject
16 );
17
18 105 ▶use Devel::StrictMode;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 105 ▶use Scalar::Util qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
20 weaken
21 isweak
22 105 );
23 105 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 105 ▶use TUI::toolkit::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
25 Maybe
26 :is
27 :types
28 105 );
29
30 sub TObject() { __PACKAGE__ }
31 1 ▶sub new_TObject { __PACKAGE__->from(@_) }
Subroutine new_TObject: called CC=1 SCAR=0.0
Pod documented
32
33 0 ▶my $unlock_value = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
34 0 ▶ Internals::SvREADONLY( $_[0] => 0 )
Branch: 1 branch
BranchTrueFalseTotal
if exists &Internals::SvREADONLY 0 0 0
35 if exists &Internals::SvREADONLY;
36 105 };
37
38 8 ▶sub BUILDARGS { # \%args ()
Subroutine BUILDARGS: called CC=2 SCAR=7.1
Pod documented
39 8 state $sig = signature(
40 method => 1,
41 named => [],
42 caller_level => +1,
43 );
44 8 my ( $class, $args ) = $sig->( @_ );
45 8 ▶ return $args ? { %$args } : {};
Branch: 1 branch
BranchTrueFalseTotal
$args ? : 8 0 8
46 }
47
48 2 ▶sub from { # $obj ();
Subroutine from: called CC=1 SCAR=0.0
Pod undocumented
49 2 state $sig = signature(
50 method => 1,
51 pos => [],
52 );
53 2 my ( $class ) = $sig->( @_ );
54 2 return $class->new();
55 }
56
57 1 ▶sub destroy { # void ($class|$self, $o|undef)
Subroutine destroy: called CC=11 SCAR=30.7
Pod documented
58 1 my ( $class, $o ) = @_;
59 1 ▶ assert ( defined $class );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $class 0 1 1
60 1 ▶ assert ( !defined $o or is_Object $o );
Branch: 1 branch
BranchTrueFalseTotal
unless not defined $o or &is_Object($o) 0 1 1
Condition33%1/3
not defined $o or &is_Object($o)
l!l&&r!l&&!r
010
MC/DC0%0/2
not defined $o or &is_Object($o)
not defined $o &is_Object($o)
Truth table33%1/3
not(A) or B
A= not defined $oB= &is_Object($o)
ABresult
1X1
011
000
61 1 ▶ $class = ref $class || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
62 1 alias: for $o ( $_[1] ) {
63 1 ▶ if ( defined $o ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $o) 1 0 1
64 1 ▶ assert ( is_Object $o );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Object($o) 0 1 1
65 1 $o->shutDown();
66 1 for ( keys %$o ) {
67 0 ▶ if ( ref $o->{$_} && !isweak $o->{$_} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $o->{$_} and not builtin::is_weak($o->{$_})) 0 0 0
Condition0%0/3
ref $o->{$_} and not builtin::is_weak($o->{$_})
!ll&&!rl&&r
000
MC/DC0%0/2
ref $o->{$_} and not builtin::is_weak($o->{$_})
ref $o->{$_} not builtin::is_weak($o->{$_})
Truth table0%0/3
A and not(B)
A= ref $o->{$_}B= not builtin::is_weak($o->{$_})
ABresult
0X0
100
111
68 0 &$unlock_value( $o->{$_} ) if STRICT;
69 0 weaken $o->{$_};
70 }
71 }
72 1 undef $o;
73 }
74 1 return;
75 } #/ alias
76 }
77
78 22 ▶sub shutDown { # void ($self)
Subroutine shutDown: called CC=1 SCAR=0.0
Pod documented
79 22 state $sig = signature(
80 method => Object,
81 pos => [],
82 );
83 22 $sig->( @_ );
84 22 return;
85 }
86
87 105 1
88
89 __END__
« lib/TUI/Drivers/Display.pm ↑ Summary lib/TUI/Validate/StringLookupValidator.pm »