Construction/Role/Input.pm

filter: Statementstmt 100% 20 / 20 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 93.7% 30 / 32 CC 4 SCAR 9.2
CC
4
Cov
96%
import_point
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Construction/Derivate/IntersectionCircleCircle.pm ↑ Summary Construction/Derivate/IntersectionLineLine.pm »
1 package Math::Geometry::Construction::Role::Input;
2 13 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 13 ▶use 5.008008;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 13 ▶use Math::Vector::Real;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 =head1 NAME
10  
11 C<Math::Geometry::Construction::Role::Input> - format conversions
12  
13 =head1 VERSION
14  
15 Version 0.024
16  
17 =cut
18  
19 13 our $VERSION = '0.024';
20  
21  
22 # This method is also used during construction time, so $self might
23 # just be a class name.
24 215 ▶sub import_point {
Subroutine import_point: called CC=4 SCAR=13.9
Pod undocumented
25 215 my ($self, $construction, $value) = @_;
26  
27 croak "Invalid construction object."
28 215 ▶ if(!eval { $construction->isa('Math::Geometry::Construction') });
Branch: 1 branch
BranchTrueFalseTotal
unless eval { do { $construction->isa("Math::Geometry::Construction") } } 0 215 215
29  
30 215 ▶ return undef if(!defined($value));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 1 214 215
31 return $value
32 214 ▶ if(eval { $value->isa('Math::Geometry::Construction::Point') });
Branch: 1 branch
BranchTrueFalseTotal
if eval { do { $value->isa("Math::Geometry::Construction::Point") } } 40 174 214
33 174 return $construction->add_point(position => $value, hidden => 1);
34 }
35  
36 13 1;
37  
38  
39 __END__
« Construction/Derivate/IntersectionCircleCircle.pm ↑ Summary Construction/Derivate/IntersectionLineLine.pm »