Construction/Derivate.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 75.0% 3 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 88.8% 8 / 9 Podpod 40.0% 2 / 5 totaltotal 84.0% 42 / 50 CC 4 SCAR 7.5
CC
4
Cov
91%
positions
4.1
calculate_positions
2.0
BEGIN
1.0
CRAP 2.1
« Construction/Role/PointSet.pm ↑ Summary Construction/Point.pm »
1 package Math::Geometry::Construction::Derivate;
2  
3 12 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 12 ▶use Math::Geometry::Construction::Types qw(ArrayRefOfGeometricObject);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 12 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 C<Math::Geometry::Construction::Derivate> - derive points from objects
12  
13 =head1 VERSION
14  
15 Version 0.019
16  
17 =cut
18  
19 12 our $VERSION = '0.019';
20  
21  
22 ###########################################################################
23 # #
24 # Class Variables and Methods #
25 # #
26 ###########################################################################
27  
28 12 our $ID_TEMPLATE = 'D%09d';
29  
30 102 ▶sub id_template { return $ID_TEMPLATE }
Subroutine id_template: called CC=1 SCAR=0.0
Pod documented
31  
32 ###########################################################################
33 # #
34 # Accessors #
35 # #
36 ###########################################################################
37  
38 12 with 'Math::Geometry::Construction::Role::Object';
39 12 with 'Math::Geometry::Construction::Role::PositionSelection';
40 12 with 'Math::Geometry::Construction::Role::Buffering';
41  
42 ###########################################################################
43 # #
44 # Retrieve Data #
45 # #
46 ###########################################################################
47  
48 0 ▶sub calculate_positions { return }
Subroutine calculate_positions: not called CC=1 SCAR=6.9
Pod undocumented
49  
50 120 ▶sub positions {
Subroutine positions: called CC=4 SCAR=14.0
Pod undocumented
51 120 my ($self) = @_;
52  
53 120 ▶ return(@{$self->buffer('positions') || []})
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_buffered("positions") 19 101 120
Condition50%1/2
$self->buffer('positions') || []
l!l
190
MC/DC0%0/1
$self->buffer('positions') || []
$self->buffer('positions')
Truth table50%1/2
A
A= $self->buffer('positions')
Aresult
11
00
54 if($self->is_buffered('positions'));
55  
56 101 my $positions = [$self->calculate_positions];
57  
58 101 ▶ $self->buffer('positions', $positions)
Branch: 1 branch
BranchTrueFalseTotal
if $self->construction->buffer_results 101 0 101
59 if($self->construction->buffer_results);
60 101 return @$positions;
61 }
62  
63 32 ▶sub register_derived_point {}
Subroutine register_derived_point: called CC=1 SCAR=0.0
Pod undocumented
64  
65 115 ▶sub create_derived_point {
Subroutine create_derived_point: called CC=1 SCAR=0.0
Pod documented
66 115 my ($self, %args) = @_;
67  
68 115 my $point = $self->construction->add_object
69 ('Math::Geometry::Construction::DerivedPoint',
70 derivate => $self,
71 %args);
72  
73 115 $self->register_derived_point($point);
74
75 115 return $point;
76 }
77  
78 ###########################################################################
79 # #
80 # Change Data #
81 # #
82 ###########################################################################
83  
84 12 1;
85  
86  
87 __END__
« Construction/Role/PointSet.pm ↑ Summary Construction/Point.pm »