Punchcard/Backend/Kiwisolver/Symbolic.pm

filter: Statementstmt 95.7% 45 / 47 Branchbran 70.0% 7 / 10 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 90.4% 66 / 73 CC 7 SCAR 9.8
CC
7
Cov
90%
_delegate_op
5.2
value
2.1
BUILD
2.0
CRAP 2.7
« Punchcard/Attributes.pm ↑ Summary Punchcard.pm »
1 1 ▶use Renard::Incunabula::Common::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Intertangle::Punchcard::Backend::Kiwisolver::Symbolic;
3 # ABSTRACT: Kiwisolver variable
4 1 $Intertangle::Punchcard::Backend::Kiwisolver::Symbolic::VERSION = '0.002';
5 1 ▶use Mu;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Graphics::Layout::Kiwisolver;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Renard::Incunabula::Common::Types qw(InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use overload nomethod => \&_delegate_op;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 has name => ( is => 'ro', predicate => 1 );
11  
12 17 has _delegate => (
13 is => 'ro',
14 isa => (
15 InstanceOf['Graphics::Layout::Kiwisolver::Variable']
16 | InstanceOf['Graphics::Layout::Kiwisolver::Term']
17 | InstanceOf['Graphics::Layout::Kiwisolver::Expression']
18 | InstanceOf['Graphics::Layout::Kiwisolver::Constraint']
19 ),
20 17 ▶ default => method() {
Subroutine __ANON__: called CC=1 SCAR=0.0
21 17 Graphics::Layout::Kiwisolver::Variable->new;
22 1 },
23 );
24  
25 60 ▶method BUILD() {
Subroutine BUILD: called CC=2 SCAR=6.9
Pod documented
26 60 ▶ if( $self->has_name ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_name) 17 43 60
27 17 $self->_delegate->setName( $self->name );
28 }
29 1 }
30  
31 43 ▶method _delegate_op($other, $inv, $meth) {
Subroutine _delegate_op: called CC=5 SCAR=16.5
32 43 my $op = overload::Method($self->_delegate, $meth);
33 43 ▶ die "Operator $meth not available" unless defined $op;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $op 0 43 43
34 43 ▶ my $return = $op->($self->_delegate, defined $other && ref $other ? $other->_delegate : $other , $inv );
Branch: 1 branch
BranchTrueFalseTotal
defined $other && ref $other ? : 14 29 43
Condition66%2/3
defined $other and ref $other
!ll&&!rl&&r
02914
MC/DC50%1/2
defined $other and ref $other
defined $other ref $other
Truth table66%2/3
A and B
A= defined $otherB= ref $other
ABresult
0X0
100
111
35  
36 43 ▶ if( $meth eq '""') {
Branch: 1 branch
BranchTrueFalseTotal
if ($meth eq "\"\"") 0 43 43
37 0 return $return;
38 }
39  
40 43 my $return_wrapper;
41 43 $return_wrapper = Intertangle::Punchcard::Backend::Kiwisolver::Symbolic->new(
42 _delegate => $return,
43 );
44  
45 43 $return_wrapper;
46 1 }
47  
48 12 ▶method value($value = undef) {
Subroutine value: called CC=2 SCAR=7.2
Pod documented
49 12 ▶ if( defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) { } 0 12 12
50 0 $self->_delegate->setValue( $value );
51 } else {
52 12 $self->_delegate->value;
53 }
54 1 }
55  
56 1 with qw(Intertangle::Punchcard::Data::Role::Variable);
57  
58 1 1;
59  
60 __END__
« Punchcard/Attributes.pm ↑ Summary Punchcard.pm »