lib/UR/BoolExpr/Template/PropertyComparison/LessThan.pm

filter: Statementstmt 61.9% 13 / 21 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 44.4% 16 / 36 CC 6 SCAR 29.5
CC
6
Cov
43%
_compare
28.1
BEGIN
1.0
BEGIN
1.0
CRAP 19.1
« blib/lib/UR/Context/Root.pm ↑ Summary blib/lib/UR/Role/Param.pm »
1  
2 package UR::BoolExpr::Template::PropertyComparison::LessThan;
3  
4 266 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 266 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 266 require UR;
7 266 our $VERSION = "0.47"; # UR $VERSION;
8  
9 266 UR::Object::Type->define(
10 class_name => __PACKAGE__,
11 is => ['UR::BoolExpr::Template::PropertyComparison'],
12 );
13  
14 0 ▶sub _compare {
Subroutine _compare: not called CC=6 SCAR=33.4
15 0 my ($class,$comparison_value,@property_value) = @_;
16 0 my $cv_is_number = Scalar::Util::looks_like_number($comparison_value);
17  
18 266 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 0 foreach my $property_value ( @property_value ) {
20 0 my $pv_is_number = Scalar::Util::looks_like_number($property_value);
21  
22 0 ▶ if ($cv_is_number and $pv_is_number) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cv_is_number and $pv_is_number) { } 0 0 0
Condition0%0/3
$cv_is_number and $pv_is_number
!ll&&!rl&&r
000
MC/DC0%0/2
$cv_is_number and $pv_is_number
$cv_is_number $pv_is_number
Truth table0%0/3
A and B
A= $cv_is_numberB= $pv_is_number
ABresult
0X0
100
111
23 0 ▶ return 1 if ( $property_value < $comparison_value );
Branch: 1 branch
BranchTrueFalseTotal
if $property_value < $comparison_value 0 0 0
24 } else {
25 0 ▶ return 1 if ( $property_value lt $comparison_value );
Branch: 1 branch
BranchTrueFalseTotal
if $property_value lt $comparison_value 0 0 0
26 }
27 }
28 0 return '';
29 }
30  
31  
32 266 1;
33  
34 =pod
35  
36 =head1 NAME
37  
38 UR::BoolExpr::Template::PropertyComparison::LessThan - perform a less than test
39  
40 =head1 DESCRIPTION
41  
42 If the property returns multiple values, this comparison returns true if any of the values are
43 less than the comparison value
44  
45 =cut
46  
« blib/lib/UR/Context/Root.pm ↑ Summary blib/lib/UR/Role/Param.pm »