| 1 | package FormValidator::Nested::Validator::DateTime; | ||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use utf8; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Scalar::Util qw/blessed/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 23 | ▶ | sub date { | ||||||||||||||||||||||||||
|
Subroutine
date: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 23 | my ( $value, $options, $req ) = @_; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 23 | ▶ | if ( blessed $value ne 'DateTime' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | 7 | return 0; | |||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | 16 | return 1; | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 5 | ▶ | sub greater_than_equal { | ||||||||||||||||||||||||||
|
Subroutine
greater_than_equal: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 18 | 5 | my ( $value, $options, $req ) = @_; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 5 | my $target_dt = $req->param($options->{target}); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 5 | ▶ | if ( | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
date($value, $options, $req) and date($target_dt, $options, $req)
MC/DC100%2/2
date($value, $options, $req) and date($target_dt, $options, $req)
date($value, $options, $req)
date($target_dt, $options, $req)
Truth table100%3/3
A and B
A= date($value, $options, $req)B= date($target_dt, $options, $req)
| |||||||||||||||||||||||||||||
| 23 | !date($value, $options, $req) | ||||||||||||||||||||||||||||
| 24 | || !date($target_dt, $options, $req) | ||||||||||||||||||||||||||||
| 25 | ) { | ||||||||||||||||||||||||||||
| 26 | # 日付形式不具合もokとする | ||||||||||||||||||||||||||||
| 27 | 2 | return 1; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 3 | ▶ | if ( $value < $target_dt ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | 1 | return 0; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | 2 | return 1; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 5 | ▶ | sub greater_than { | ||||||||||||||||||||||||||
|
Subroutine
greater_than: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 5 | my ( $value, $options, $req ) = @_; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 5 | my $target_dt = $req->param($options->{target}); | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 5 | ▶ | if ( | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
date($value, $options, $req) and date($target_dt, $options, $req)
MC/DC100%2/2
date($value, $options, $req) and date($target_dt, $options, $req)
date($value, $options, $req)
date($target_dt, $options, $req)
Truth table100%3/3
A and B
A= date($value, $options, $req)B= date($target_dt, $options, $req)
| |||||||||||||||||||||||||||||
| 42 | !date($value, $options, $req) | ||||||||||||||||||||||||||||
| 43 | || !date($target_dt, $options, $req) | ||||||||||||||||||||||||||||
| 44 | ) { | ||||||||||||||||||||||||||||
| 45 | # 日付形式不具合もokとする | ||||||||||||||||||||||||||||
| 46 | 2 | return 1; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 3 | ▶ | if ( $value <= $target_dt ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | 2 | return 0; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | 1 | return 1; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 3 | 1; | |||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||