| 1 | package Data::Sah::Human; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | #use Log::Any::IfLOG qw($log); | ||||||||||||
| 7 | |||||||||||||
| 8 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||
| 9 | 1 | our $DATE = '2024-02-16'; # DATE | |||||||||||
| 10 | 1 | our $DIST = 'Data-Sah'; # DIST | |||||||||||
| 11 | 1 | our $VERSION = '0.917'; # VERSION | |||||||||||
| 12 | |||||||||||||
| 13 | 1 | ▶ | our $Log_Validator_Code = $ENV{LOG_SAH_VALIDATOR_CODE} // 0; | ||||||||||
|
Condition50%1/2
$ENV{"LOG_SAH_VALIDATOR_CODE"} // 0
MC/DC0%0/1
$ENV{"LOG_SAH_VALIDATOR_CODE"} // 0
$ENV{"LOG_SAH_VALIDATOR_CODE"}
Truth table50%1/2
A
A= $ENV{"LOG_SAH_VALIDATOR_CODE"}
| |||||||||||||
| 14 | |||||||||||||
| 15 | 1 | require Exporter; | |||||||||||
| 16 | 1 | our @ISA = qw(Exporter); | |||||||||||
| 17 | 1 | our @EXPORT_OK = qw(gen_human_msg); | |||||||||||
| 18 | |||||||||||||
| 19 | 0 | ▶ | sub gen_human_msg { | ||||||||||
|
Subroutine
gen_human_msg: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 20 | 0 | require Data::Sah; | |||||||||||
| 21 | |||||||||||||
| 22 | 0 | my ($schema, $opts) = @_; | |||||||||||
| 23 | |||||||||||||
| 24 | 0 | state $hc = Data::Sah->new->get_compiler("human"); | |||||||||||
| 25 | |||||||||||||
| 26 | 0 | ▶ | my %args = (schema => $schema, %{$opts // {}}); | ||||||||||
|
Condition0%0/2
$opts // {}
MC/DC0%0/1
$opts // {}
$opts
Truth table0%0/2
A
A= $opts
| |||||||||||||
| 27 | 0 | my $opt_source = delete $args{source}; | |||||||||||
| 28 | |||||||||||||
| 29 | 0 | ▶ | $args{log_result} = 1 if $Log_Validator_Code; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | |||||||||||||
| 31 | 0 | my $cd = $hc->compile(%args); | |||||||||||
| 32 | 0 | ▶ | $opt_source ? $cd : $cd->{result}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 1 | 1; | |||||||||||
| 36 | # ABSTRACT: Some functions to use Data::Sah human compiler | ||||||||||||
| 37 | |||||||||||||
| 38 | __END__ | ||||||||||||