DWH_File/Tie/Scalar.pm

filter: Statementstmt 87.8% 36 / 41 Branchbran 50.0% 2 / 4 Conditioncond 62.5% 5 / 8 MC/DCmcdc 20.0% 1 / 5 Subroutinesub 91.6% 11 / 12 Podpod 0.0% 0 / 5 totaltotal 73.3% 55 / 75 CC 6 SCAR 9.2
CC
6
Cov
81%
tie_reference
5.5
wake_up_call
2.1
vanish
2.0
CRAP 2.5
« DWH_File/Tie/Hash/Node.pm ↑ Summary DWH_File/Value/Undef.pm »
1 package DWH_File::Tie::Scalar;
2  
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use vars qw( @ISA $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use DWH_File::Slot;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 @ISA = qw( DWH_File::Tie DWH_File::Slot );
10 9 $VERSION = 0.01;
11  
12 3 ▶sub TIESCALAR {
Subroutine TIESCALAR: called CC=1 SCAR=0.0
13 3 my $this = shift;
14 3 my $self = $this->perform_tie( @_ );
15 }
16  
17 1 ▶sub STORE {
Subroutine STORE: called CC=1 SCAR=0.0
18 1 my ( $self, $value_in ) = @_;
19 $self->set_value( DWH_File::Value::Factory->from_input( $self->{ kernel },
20 1 $value_in ) );
21 # make lazy
22 1 $self->{ kernel }->save_custom_grounding( $self );
23 }
24  
25 5 ▶sub FETCH { $_[ 0 ]->{ value }->actual_value }
Subroutine FETCH: called CC=1 SCAR=0.0
26  
27 3 ▶sub tie_reference {
Subroutine tie_reference: called CC=5 SCAR=17.0
Pod undocumented
28 3 my $text;
29 3 ▶ $_[ 2 ] ||= \$text;
Condition100%2/2
$_[2] ||= \$text
l!l
12
MC/DC100%1/1
$_[2] ||= \$text
$_[2]
Truth table100%2/2
A
A= $_[2]
Aresult
11
00
30 3 my ( $this, $kernel, $ref, $blessing, $id, $tail ) = @_;
31 3 ▶ my $class = ref $this || $this;
Condition33%1/3
ref $this || $this
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table33%1/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
32 3 ▶ $blessing ||= ref $ref;
Condition66%2/3
$blessing ||= ref $ref
l!l&&r!l&&!r
210
MC/DC0%0/2
$blessing ||= ref $ref
$blessing ref $ref
Truth table66%2/3
A ||= B
A= $blessingB= ref $ref
ABresult
1X1
011
000
33 3 my $instance = tie $$ref, $class, $kernel,
34 $ref, $id, $tail;
35 0 ▶ if ( $blessing ne 'SCALAR' ) { bless $ref, $blessing }
Branch: 1 branch
BranchTrueFalseTotal
if ($blessing ne "SCALAR") 0 3 3
36 3 return $instance;
37 }
38  
39 2 ▶sub wake_up_call {
Subroutine wake_up_call: called CC=2 SCAR=7.6
Pod undocumented
40 2 my ( $self, $tail ) = @_;
41 0 ▶ unless ( defined $tail ) { die "Tail anomaly" }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $tail) 0 2 2
42 $self->{ value } = DWH_File::Value::Factory->from_stored(
43 $self->{ kernel },
44 2 $tail );
45 }
46  
47 1 ▶sub sign_in_first_time {
Subroutine sign_in_first_time: called CC=1 SCAR=0.0
Pod undocumented
48 1 my ( $self ) = @_;
49 $self->set_value( DWH_File::Value::Factory->
50 from_input( $self->{ kernel },
51 1 ${ $self->{ content } } ) );
52 }
53  
54 2 ▶sub custom_grounding { $_[ 0 ]->{ value } }
Subroutine custom_grounding: called CC=1 SCAR=0.0
Pod undocumented
55  
56 0 ▶sub vanish {
Subroutine vanish: not called CC=1 SCAR=6.9
Pod undocumented
57 0 my ( $self ) = @_;
58 0 $self->release;
59 0 $self->{ kernel }->unground( $self );
60 }
61  
62 9 1;
63  
64 __END__
« DWH_File/Tie/Hash/Node.pm ↑ Summary DWH_File/Value/Undef.pm »