Construction/FixedPoint.pm

filter: Statementstmt 100% 29 / 29 Branchbran 100% 4 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 95.8% 46 / 48 CC 4 SCAR 5.5
CC
4
Cov
97%
BUILDARGS
3.0
position
2.0
BEGIN
1.0
CRAP 1.7
« Construction/Role/Output.pm ↑ Summary Construction/DerivedPoint.pm »
1 package Math::Geometry::Construction::FixedPoint;
2 15 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 15 extends 'Math::Geometry::Construction::Point';
4  
5 15 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 15 ▶use Math::Geometry::Construction::Vector;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 15 ▶use Math::Geometry::Construction::Types qw(Vector);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 15 ▶use Math::Vector::Real;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 15 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =head1 NAME
13  
14 C<Math::Geometry::Construction::FixedPoint> - independent user-defined point
15  
16 =head1 VERSION
17  
18 Version 0.024
19  
20 =cut
21  
22 15 our $VERSION = '0.024';
23  
24  
25 ###########################################################################
26 # #
27 # Accessors #
28 # #
29 ###########################################################################
30  
31 15 with 'Math::Geometry::Construction::Role::Buffering';
32  
33 15 has 'position_vector' => (isa => Vector,
34 coerce => 1,
35 is => 'rw',
36 required => 1,
37 init_arg => 'position',
38 trigger => \&clear_global_buffer);
39  
40 242 ▶sub BUILDARGS {
Subroutine BUILDARGS: called CC=3 SCAR=11.0
Pod documented
41 242 my ($class, %args) = @_;
42  
43 242 ▶ if(defined($args{x}) and defined($args{y})) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $args{"x"} and defined $args{"y"}) 2 240 242
Condition66%2/3
defined $args{"x"} and defined $args{"y"}
!ll&&!rl&&r
24002
MC/DC50%1/2
defined $args{"x"} and defined $args{"y"}
defined $args{"x"} defined $args{"y"}
Truth table66%2/3
A and B
A= defined $args{"x"}B= defined $args{"y"}
ABresult
0X0
100
111
44 2 $args{position} = V($args{x}, $args{y});
45 }
46  
47 242 return \%args;
48 }
49  
50 ###########################################################################
51 # #
52 # Retrieve Data #
53 # #
54 ###########################################################################
55  
56 495 ▶sub position {
Subroutine position: called CC=2 SCAR=6.9
Pod documented
57 495 my ($self, @args) = @_;
58  
59 495 ▶ return $self->position_vector(@args) if(@args);
Branch: 1 branch
BranchTrueFalseTotal
if @args 14 481 495
60 481 return $self->position_vector->value;
61 }
62  
63 ###########################################################################
64 # #
65 # Change Data #
66 # #
67 ###########################################################################
68  
69 15 1;
70  
71  
72 __END__
« Construction/Role/Output.pm ↑ Summary Construction/DerivedPoint.pm »