Branch Coverage

blib/lib/TUWF/Misc.pm
Criterion Covered Total %
branch 55 96 57.2


line true false branch
29 4 9 if defined $_[1]{'min'} and $_[0] < $_[1]{'min'}
30 3 6 if defined $_[1]{'max'} and $_[0] > $_[1]{'max'}
60 81 11 unless $f->{'multi'}
65 50 47 if not $errfield or $errfield eq "default"
69 11 81 $f->{'multi'} ? :
72 2 90 if $f->{'mincount'} and @values < $f->{'mincount'}
73 2 90 if $f->{'maxcount'} and @values > $f->{'maxcount'}
76 51 41 if @err
83 517 379 unless $rules->{'template'}
85 17 362 if (exists $tpl->{$field}) { }
99 86 11 unless exists $r->{'required'}
100 88 9 unless exists $r->{'rmwhitespace'}
103 75 7 if ($v and $r->{'rmwhitespace'})
111 9 88 if (not defined $v or length $v < 1)
112 6 3 if $r->{'required'}
113 2 1 if exists $r->{'default'}
125 0 155 if $r->{'template'} and not $$t{$r->{'template'}}
128 2 153 if $r->{'minlength'} and length $v < $r->{'minlength'}
129 3 150 if $r->{'maxlength'} and length $v > $r->{'maxlength'}
131 1 149 if $r->{'enum'} and not grep(($_ eq $v), @{$$r{"enum"};})
133 1 52 ref $r->{'regex'} eq 'ARRAY' ? :
25 28 if $r->{'regex'} and ref $r->{'regex'} eq "ARRAY" ? !($v =~ /$r->{'regex'}[0]/i) : !($v =~ /$r->{'regex'}/)
135 67 57 if ($r->{'template'})
137 11 23 exists $r->{$_} ? :
18 49 $in ? :
138 32 35 if _validate($_[0], $t, \%r)
141 1 18 ref $r->{'func'} eq 'ARRAY' ? :
10 9 if $r->{'func'} and ref $r->{'func'} eq "ARRAY" ? !$r->{'func'}[0]->($_[0], $r) : !$r->{'func'}->($_[0], $r)
170 0 0 unless $hs{'To'}
171 0 0 unless $hs{'Subject'}
183 0 0 if ($self->{'_TUWF'}{'mail_sendmail'} eq 'log') { }
0 0 elsif (open my $mailer, '|-:utf8', "$self->{'_TUWF'}{'mail_sendmail'} -t -f '$hs{'From'}'") { }
187 0 0 if not close $mailer
201 0 0 ref $_[0] eq 'TUWF::Validate' ? :
209 0 0 if $what eq "json"
214 0 0 @v > 1 ? :
0 0 if $what eq "param"
221 0 0 $what eq 'param' ? :
0 0 $what eq 'post' ? :
0 0 $what eq 'get' ? :
224 0 0 if @_ == 1
227 0 0 if @_ == 2
237 0 0 if $INC{'JSON/XS.pm'}
238 0 0 if $INC{'Cpanel/JSON/XS.pm'}
239 0 0 if $INC{'JSON/PP.pm'}
240 0 0 if eval { do { require JSON::XS; 1 } }
241 0 0 if eval { do { require Cpanel::JSON::XS; 1 } }
242 0 0 unless eval { do { require JSON::PP; 1 } }