Data/Sah/Human.pm

filter: Statementstmt 65.3% 17 / 26 Branchbran 0.0% 0 / 4 Conditioncond 25.0% 1 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 53.6% 22 / 41 CC 4 SCAR 24.7
CC
4
Cov
53%
gen_human_msg
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 11.9
« Data/Sah/Compiler/perl/TH/str.pm ↑ Summary Data/Sah/Compiler/perl.pm »
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
l!l
01
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"}
Aresult
11
00
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 // {}
l!l
00
MC/DC0%0/1
$opts // {}
$opts
Truth table0%0/2
A
A= $opts
Aresult
11
00
27 0 my $opt_source = delete $args{source};
28  
29 0 ▶ $args{log_result} = 1 if $Log_Validator_Code;
Branch: 1 branch
BranchTrueFalseTotal
if $Data::Sah::Human::Log_Validator_Code 0 0 0
30  
31 0 my $cd = $hc->compile(%args);
32 0 ▶ $opt_source ? $cd : $cd->{result};
Branch: 1 branch
BranchTrueFalseTotal
$opt_source ? : 0 0 0
33 }
34  
35 1 1;
36 # ABSTRACT: Some functions to use Data::Sah human compiler
37  
38 __END__
« Data/Sah/Compiler/perl/TH/str.pm ↑ Summary Data/Sah/Compiler/perl.pm »