GraphItems/TiedCoord.pm

filter: Statementstmt 39.2% 11 / 28 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 3 / 6 Podpod n/a totaltotal 34.1% 14 / 41 CC 4 SCAR 17.7
CC
4
Cov
32%
FETCH
12.0
STORE
6.0
TIESCALAR
2.0
CRAP 5.9
« GraphItems/GraphItem.pm ↑ Summary GraphItems.pm »
1 # Copyright (c) 2007 by Christoph Lamprecht. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
4 # ch.l.ngre@online.de
5  
6 package Tk::GraphItems::TiedCoord;
7 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use Scalar::Util (qw/weaken/);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 our $VERSION = '0.11';
11  
12 0 ▶sub TIESCALAR{
Subroutine TIESCALAR: not called CC=1 SCAR=6.9
13 0 my($class,$t_b,$c_in)=@_;
14 0 my $self = bless{TkGNode =>$t_b,
15 coord_index =>$c_in},$class;
16 0 weaken ($self->{TkGNode});
17 0 $self;
18 }
19  
20 0 ▶sub FETCH{
Subroutine FETCH: not called CC=3 SCAR=24.8
21 0 my $self = shift;
22 0 my $i = $self->{coord_index};
23 0 ▶ if ($self->{TkGNode}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"TkGNode"}) 0 0 0
24 0 return ($self->{TkGNode}->get_coords)[$i];
25 }
26 0 ▶ return $self->{cached}[$i]||0;
Condition0%0/2
$self->{'cached'}[$i] || 0
l!l
00
MC/DC0%0/1
$self->{'cached'}[$i] || 0
$self->{'cached'}[$i]
Truth table0%0/2
A
A= $self->{'cached'}[$i]
Aresult
11
00
27 }
28  
29 0 ▶sub STORE{
Subroutine STORE: not called CC=2 SCAR=17.9
30 0 my ($self,$value) = @_;
31 0 my $i = $self->{coord_index};
32 0 my $tb = $self->{TkGNode};
33 0 $self->{cached}[$i]= $value;
34 0 ▶ return unless $tb;
Branch: 1 branch
BranchTrueFalseTotal
unless $tb 0 0 0
35 0 my @coords = $tb->get_coords;
36 0 $coords[$i] = $value;
37 0 $tb->set_coords(@coords);
38 }
39 5 1;
40  
41  
42 __END__
« GraphItems/GraphItem.pm ↑ Summary GraphItems.pm »