Branch Coverage

blib/lib/CGI/AutoForm.pm
Criterion Covered Total %
branch 0 696 0.0


line true false branch
855 0 0 if (defined $readonly)
886 0 0 if (defined $name)
904 0 0 if (defined $action)
921 0 0 if (defined $heading)
938 0 0 if (defined $submit_value)
999 0 0 unless $table_name
1001 0 0 unless ($fields > 0)
1061 0 0 if $i < 0
1115 0 0 if (ref $field and %$field) { }
0 0 elsif (ref $field) { }
1117 0 0 unless ($field = $self->_export_field($field))
1119 0 0 unless defined $field
1145 0 0 $usage eq $CGI::AutoForm::SEARCH_GROUP ? :
1212 0 0 if not ref $pick_list and exists $$group{'table'}{'io'}{'picklist'}{$fname} and @{$$group{'table'}{'io'}{'picklist'}{$fname};}
1214 0 0 if ($type eq 'SELECT' || $type eq 'RADIO' || $type eq 'CHECKBOX' || $type eq 'CHECKGROUP' || $all_db_defn and not ref $pick_list) { }
0 0 elsif (ref $pick_list) { }
1222 0 0 if ($masker) { }
1229 0 0 unless ($all_db_defn)
1231 0 0 if (defined $masker) { }
1249 0 0 if ($all_db_defn and ref $pick_list)
1257 0 0 if ($$group{'table'}{'io'}{'column_types'}{$fname} eq 'SET')
1268 0 0 if $$group{'table'}{'io'}{'column_types'}{$fname} eq 'SET'
1273 0 0 if $no_group
1277 0 0 if ($type eq 'TEXT' and _isdate($field_attrs) and not $usage) { }
0 0 elsif ($type eq 'MATCH TEXT') { }
0 0 elsif ($type eq 'CHECKGROUP') { }
0 0 elsif ($type eq 'COMMALIST') { }
1313 0 0 unless ($field = $self->create_field($field, $picklist))
1353 0 0 unless defined $mid
1355 0 0 if exists $$self{'group_hash'}{$name}
1376 0 0 unless defined $mid
1410 0 0 if ref $field
1420 0 0 if ref $field
1442 0 0 if ($group) { }
1455 0 0 if $$field{'FIELD_NAME'} eq $field_name
1459 0 0 if @{$field_list;} == $i
1484 0 0 unless ($fields > 0)
1516 0 0 if (ref $searcher) { }
0 0 elsif (not defined $searcher) { }
1529 0 0 unless (@$recs)
1532 0 0 if ($table = 'DBIx::IO::Table'->new($self->dbh, undef, undef, $orig_table_name)) { }
1537 0 0 unless $$table{'io'}->is_ignore_type($table->column_type($col))
1540 0 0 unless ($no_group)
1548 0 0 unless defined $table
1550 0 0 unless @$recs
1558 0 0 if ($$rec{'USE_DATA_DICT'} eq 'Y' or $all_db_defn) { }
1561 0 0 unless ($rv = $self->use_data_dict($rec, $orig_table_name, $table, $no_group))
1563 0 0 if defined $rv
1569 0 0 unless $$rec{'DATATYPE'}
1573 0 0 if (not $$rec{'SEARCH_CONTROL_TYPE'} and $usage eq $CGI::AutoForm::SEARCH_GROUP) { }
0 0 elsif (not $$rec{'INPUT_CONTROL_TYPE'} || $self->is_readonly($rec)) { }
1576 0 0 if ($ir) { }
0 0 elsif (_isdate($rec)) { }
1578 0 0 if $ir eq 'DATE'
1579 0 0 if $ir eq 'DATETIME'
1580 0 0 if $ir eq 'SELECT'
1581 0 0 if $ir eq 'RADIO'
1585 0 0 if $$rec{'DATATYPE'} eq 'DATETIME'
1586 0 0 if $$rec{'DATATYPE'} eq 'DATE'
1595 0 0 if (_isdate($rec)) { }
1597 0 0 if $$rec{'DATATYPE'} eq 'DATETIME'
1598 0 0 if $$rec{'DATATYPE'} eq 'DATE'
1608 0 0 if $$group{'table'} and $type = $$group{'table'}->column_type($$rec{'FIELD_NAME'}) and $$group{'table'}{'ioclass'} eq 'DBIx::IO::OracleIO' and $type eq 'LONG' || $type eq 'RAW' || $type eq 'LONG RAW'
1615 0 0 if $usage eq $CGI::AutoForm::SEARCH_GROUP
1616 0 0 if defined $$defaults{$fname}
1617 0 0 unless length $$rec{'HEADING'}
1618 0 0 if not length $$rec{'BRIEF_HEADING'} and $all_db_defn
1620 0 0 unless ($field)
1622 0 0 if defined $field
1637 0 0 unless ($table and %$table)
1639 0 0 unless ($table = 'DBIx::IO::Table'->new($self->dbh, undef, undef, $table_name))
1643 0 0 unless ($no_group)
1651 0 0 unless $io->column_type($fname)
1652 0 0 if ($io->is_datetime($fname)) { }
0 0 elsif ($io->is_date($fname)) { }
1660 0 0 unless ($$field{'DATATYPE'})
1662 0 0 if $$field{'_imp_datetype'}
1666 0 0 if $$field{'_imp_datetype'}
1667 0 0 unless length $$field{'DEFAULT_VALUE'} or not length $dval
1668 0 0 $io->required($fname) ? :
0 0 unless $$field{'REQUIRED'}
1670 0 0 if ($$field{'DATATYPE'} eq 'DATE') { }
0 0 elsif ($$field{'DATATYPE'} eq 'DATETIME') { }
1680 0 0 $flen > $CGI::AutoForm::DEFAULT_FIELD_LENGTH ? :
0 0 unless $$field{'INPUT_SIZE'}
1682 0 0 unless $$field{'INPUT_MAXLENGTH'}
1694 0 0 if ($type eq 'TEXT' or $type eq 'PASSWORD' or $type eq 'MATCH TEXT' or $type eq 'COMMALIST') { }
0 0 elsif ($type eq 'TEXTAREA') { }
0 0 elsif ($type eq 'SELECT') { }
0 0 elsif ($type eq $CGI::AutoForm::DISPLAY_ONLY_GROUP) { }
0 0 elsif ($type eq 'CHECKBOX' or $type eq 'CHECKGROUP') { }
0 0 elsif ($type eq 'RADIO') { }
0 0 elsif ($type eq 'FILE') { }
1739 0 0 if ($need_req)
1741 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1746 0 0 $need_req_class ? :
1768 0 0 if (ref $$field{'VALUE'} eq 'ARRAY') { }
0 0 elsif (not ref $$field{'VALUE'}) { }
1774 0 0 if defined $$field{'VALUE'}
1783 0 0 if ($need_req)
1785 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1791 0 0 $$field{'RADIO_CHECKBOX_COLS'} ? :
1795 0 0 if $new_row
1797 0 0 $need_req_class ? :
1823 0 0 if ref $val
1825 0 0 if defined $val
1828 0 0 $$field{'RADIO_CHECKBOX_COLS'} ? :
1832 0 0 if ($need_req)
1834 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1840 0 0 if $new_row
1842 0 0 $need_req_class ? :
1862 0 0 if (ref $val) { }
1887 0 0 if ($need_req)
1889 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1892 0 0 $need_req_class ? :
1898 0 0 if (ref $$field{'VALUE'} eq 'ARRAY') { }
0 0 elsif (not ref $$field{'VALUE'}) { }
1904 0 0 if defined $$field{'VALUE'}
1912 0 0 if ($usage eq $CGI::AutoForm::SEARCH_GROUP)
1914 0 0 $$field{'SEARCH_MULT_SELECT'} ? :
1917 0 0 unless ($need_req)
1919 0 0 %selected ? :
1938 0 0 if ($need_req)
1940 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1945 0 0 if $type eq 'MATCH TEXT'
1947 0 0 if ($type eq 'COMMALIST')
1953 0 0 if ref $val
1956 0 0 if ref $val
1958 0 0 $$field{'INPUT_SIZE'} ? :
0 0 $$field{'INPUT_MAXLENGTH'} ? :
0 0 $need_req_class ? :
0 0 $type eq 'MATCH TEXT' ? :
0 0 $type eq 'COMMALIST' ? :
1975 0 0 if ($need_req)
1977 0 0 unless $$field{'ELEMENT_ATTRS'} =~ s/CLASS\s*=\s*['"]?(.*?)['"]?/CLASS="$1 REQI"/i
1981 0 0 if ref $val
1983 0 0 $need_req_class ? :
2017 0 0 if (defined $hidden)
2041 0 0 if (not ref $val) { }
0 0 elsif (not ref $val eq 'ARRAY') { }
2069 0 0 if ($self->is_readonly) { }
0 0 elsif ($usage eq $CGI::AutoForm::EDIT_GROUP) { }
0 0 elsif ($usage eq $CGI::AutoForm::SEARCH_GROUP) { }
0 0 elsif ($usage eq $CGI::AutoForm::INSERT_GROUP) { }
2108 0 0 if ($self->is_readonly($field)) { }
2115 0 0 if ($self->_isdate_inscontrol($field)) { }
2121 0 0 if ($$field{'INPUT_CONTROL_TYPE'} eq 'CHECKGROUP')
2149 0 0 if ($delete_end)
2152 0 0 if $$self{'curr_field_no'} == $#$field_list
2165 0 0 if $field_name =~ /^$name\./
2177 0 0 unless $$field{'INSERTABLE'} eq 'Y'
2179 0 0 if (exists $$self{'struct_query'}{$self->current_group_name}) { }
0 0 elsif ($rec = $self->current_record) { }
2186 0 0 if not length $val and $$self{'coalesce_default_insert'}
2193 0 0 if ($self->_isdate_inscontrol($field)) { }
0 0 elsif ($$field{'FIELD_GROUP'} eq 'CONFIRM') { }
2202 0 0 if ($$field{'INPUT_CONTROL_TYPE'} eq 'CHECKGROUP')
2247 0 0 unless $$field{'SEARCHABLE'} eq 'Y'
2251 0 0 if exists $$self{'struct_query'}{$gname}
2253 0 0 if ref $rec
2255 0 0 if ($type eq 'DATERANGE' or $type eq 'DATETRANGE') { }
0 0 elsif ($type eq 'DATE' or $type eq 'DATETIME') { }
0 0 elsif ($type eq 'RANGE') { }
0 0 elsif ($type eq 'MATCH TEXT') { }
0 0 elsif ($type eq 'COMMALIST') { }
2258 0 0 if ($qhit)
2269 0 0 if $qhit
2275 0 0 if ($qhit)
2284 0 0 if $qhit
2288 0 0 if $qhit
2292 0 0 if $qhit
2329 0 0 if ($rec = $self->current_record) { }
0 0 elsif (exists $$self{'struct_query'}{$self->current_group_name}) { }
2337 0 0 unless $rec
2343 0 0 if $usage eq $CGI::AutoForm::DISPLAY_ONLY_GROUP and not $$group{'tabular'} or $usage eq $CGI::AutoForm::INSERT_GROUP and $$field{'INSERTABLE'} ne 'Y' or $usage eq $CGI::AutoForm::EDIT_GROUP and $$field{'UPDATABLE'} ne 'Y' or $usage eq $CGI::AutoForm::SEARCH_GROUP and $$field{'SEARCHABLE'} ne 'Y'
2358 0 0 if $isdate
2360 0 0 if ($$field{'INPUT_CONTROL_TYPE'} eq 'CHECKGROUP' and ref $$field{'PICK_HASH'}) { }
2364 0 0 exists $$field{'PICK_HASH'}{$sp} ? :
2371 0 0 ref $$field{'PICK_HASH'} ? :
2383 0 0 if ($type eq $DBIx::IO::GenLib::DATE_TYPE) { }
0 0 elsif ($type eq $DBIx::IO::GenLib::DATETIME_TYPE) { }
2523 0 0 if ($$group{'tabular'} and $rec_no == 0)
2525 0 0 unless %$record
2528 0 0 if ($$group{'tabular'} and $rec_no == $rec_count)
2534 0 0 $head_rec ? :
2536 0 0 if ($$group{'tabular'})
2538 0 0 if ($rec_no == 0)
2543 0 0 if ref $$self{'rec_callback'} eq 'CODE'
2544 0 0 $tail_rec ? :
2549 0 0 if $$group{'js'}
2553 0 0 unless defined $$group{'head_html'}
2554 0 0 unless defined $$group{'tail_html'}
2558 0 0 if $$self{'heading'}
2559 0 0 unless defined $$self{'head_html'}
2561 0 0 if ($$self{'valid_error'})
2563 0 0 unless $$self{'verr_msg'}
2567 0 0 if length $$self{'submit_value'}
2569 0 0 unless defined $$self{'tail_html'}
2571 0 0 if $$self{'ast_foot'}
2574 0 0 if $$self{'_ast_match'}
2575 0 0 if $$self{'_cst_match'}
2579 0 0 if $$self{'noscript'}
2588 0 0 if (ref $field_s eq 'ARRAY') { }
2590 0 0 if (ref $$field_s[1] eq 'ARRAY') { }
0 0 elsif (substr($$field_s[0]{'FORM_ELEMENT_NAME'}, -6) eq '_MONTH') { }
0 0 elsif ($self->group_usage eq $CGI::AutoForm::SEARCH_GROUP) { }
0 0 elsif ($$field_s[0]{'FIELD_GROUP'} eq 'CONFIRM') { }
2592 0 0 if ($self->group_usage eq $CGI::AutoForm::SEARCH_GROUP) { }
0 0 elsif ($$field_s[1][0]{'FIELD_GROUP'} eq 'CONFIRM') { }
2604 0 0 unless $$group{'tabular'}
2626 0 0 unless $$group{'tabular'}
2636 0 0 if ($$group{'tabular'}) { }
2638 0 0 unless length $$field_s{'BRIEF_HEADING'}
2639 0 0 if ($head_rec)
2645 0 0 if ref $$self{'val_callback'}
2646 0 0 if ($tail_rec and $$group{'TABULAR_TD_TAIL_STYLE'})
2651 0 0 if ($$field_s{'TABULAR_TD_STYLE'})
2655 0 0 $$field_s{'VALID_ERROR'} ? :
0 0 $tail_rec ? :
0 0 length $val ? :
2665 0 0 if ref $$self{'val_callback'}
2668 0 0 if $label_class_add
2669 0 0 if $$field_s{'REQUIRED'} eq 'Y'
2670 0 0 if $valerr
2672 0 0 if $class
2673 0 0 if $headadd
2676 0 0 if $valerr
2680 0 0 if ref $$self{'rec_callback'} eq 'CODE'
2690 0 0 if (ref $$self{'head_callback'}) { }
2693 0 0 if $head ne $call_head
2699 0 0 if (not $self->readonly and $$field_s{'REQUIRED'} eq 'Y' and $usage eq $CGI::AutoForm::INSERT_GROUP || $usage eq $CGI::AutoForm::EDIT_GROUP)
2705 0 0 if (length $$field_s{'HELP_SUMMARY'})
2769 0 0 if ($tit eq '_MONTH') { }
0 0 elsif ($tit eq '_DAY') { }
0 0 elsif ($tit eq '_YEAR') { }
0 0 elsif ($tit eq '_HOUR') { }
0 0 elsif ($tit eq '_MIN') { }
2807 0 0 if ($tit eq '_QUANT') { }
0 0 elsif ($tit eq '_UNIT') { }
2845 0 0 if (defined $field)
2892 0 0 if not $rec and $$self{'curr_rec_no'} == 0
2917 0 0 unless defined $group_name
2918 0 0 unless defined $heading
2959 0 0 if $usage eq $CGI::AutoForm::SEARCH_GROUP
2960 0 0 if $self->readonly or $usage eq $CGI::AutoForm::DISPLAY_ONLY_GROUP
2961 0 0 if $field and $usage eq $CGI::AutoForm::EDIT_GROUP and $$field{'UPDATABLE'} ne 'Y'
2978 0 0 if ($$attrs{'SEARCH_CONTROL_TYPE'} eq 'DATERANGE') { }
3008 0 0 if ($dateval eq '_SYSDATE')
3013 0 0 if ($dateval =~ /(\d\d\d\d)(\d\d)(\d\d)/) { }
0 0 elsif (length $dateval) { }
3033 0 0 unless $year != 0 or $$attrs{'REQUIRED'} ne 'Y'
3065 0 0 length $name_fill ? :
3084 0 0 if exists $$templ{$prop} and not exists $$target{$prop}
3104 0 0 if ($type eq 'DATE') { }
0 0 elsif ($type eq 'DATETIME') { }
3151 0 0 if (defined $group_name) { }
3162 0 0 if ($usage eq $CGI::AutoForm::EDIT_GROUP)
3172 0 0 unless ref $record eq 'ARRAY'
3190 0 0 if $$self{'curr_rec_no'} < 0
3258 0 0 if $usage eq $CGI::AutoForm::DISPLAY_ONLY_GROUP
3264 0 0 if ($usage eq $CGI::AutoForm::INSERT_GROUP and $$field{'INSERTABLE'} ne 'Y' or $usage eq $CGI::AutoForm::EDIT_GROUP and $$field{'UPDATABLE'} ne 'Y' or $usage eq $CGI::AutoForm::SEARCH_GROUP and $$field{'SEARCHABLE'} ne 'Y')
3269 0 0 if not length $v or $usage eq $CGI::AutoForm::EDIT_GROUP
3277 0 0 if ($type eq 'RANGE' or $type eq 'DATERANGE' or $type eq 'DATETRANGE') { }
0 0 elsif ($type eq 'MATCH TEXT' or $type eq 'COMMALIST') { }
0 0 elsif ($type eq 'CHECKGROUP') { }
3281 0 0 if (length $rs || length $re and not length $rs && length $re) { }
3284 0 0 unless length $re
3285 0 0 unless length $rs
3289 0 0 if $valid = $self->_validate($field, $rs, $valid, $callback, $group)
3301 0 0 $$field{'MULTI_INSERT_DELIMITER'} ? :
3308 0 0 if ($$field{'REQUIRED'} eq 'Y' and scalar @values == 0) { }
3318 0 0 unless $valid
3329 0 0 unless $valid
3338 0 0 if (ref $val eq 'HASH' and not %$val) { }
0 0 elsif ($$field{'REQUIRED'} eq 'Y' and not length $val) { }
0 0 elsif (length $val and not ref $val) { }
3355 0 0 $$field{'DATATYPE'} ? :
0 0 ref $$group{'table'} && length $ct ? :
0 0 if (($rv = $$field{'DATATYPE'} ? _verify_datatype($val, $$field{'DATATYPE'}, $$field{'_imp_datetype'}) : 1) > 0 and ref $$group{'table'} && length $ct ? ($rv = $$group{'table'}->verify_datatype($val, $$field{'FIELD_NAME'})) > 0 : 1) { }
3359 0 0 if ($$field{'INPUT_MAXLENGTH'} and $$field{'INPUT_MAXLENGTH'} < length $val) { }
0 0 elsif (ref $$field{'PICK_HASH'} and not exists $$field{'PICK_HASH'}{$val}) { }
0 0 elsif (ref $callback eq 'CODE') { }
3373 0 0 unless ($success)
3376 0 0 $err_message ? :
3383 0 0 if ($rv == 0) { }
0 0 elsif ($rv == -1) { }
0 0 elsif ($rv == -2) { }
0 0 elsif ($rv == -3) { }
3412 0 0 if ($type eq 'NUMBER') { }
0 0 elsif ($type =~ /INT/) { }
0 0 elsif ($datetype eq 'DATETIME' || $datetype eq 'DATE' and not $val =~ /^\d{2,14}$/) { }
3418 0 0 unless DBIx::IO::GenLib::isint($val)
3419 0 0 if ($type =~ /UNSIGNED/)
3421 0 0 unless $val > 0
3440 0 0 if ($val =~ /^(\d\d\d\d)(\d\d)(\d\d)(?:(\d\d)(\d\d)(\d\d)?)?$/) { }
0 0 elsif ($val =~ /^(\d{1,2})\W([A-Za-z]{3})\W(\d{4})(?:\s+(\d{1,2})\W(\d\d)(?:\W(\d\d))?)?$/) { }
3451 0 0 if $m eq uc substr($mon, 0, 3)
3468 0 0 if ($y == 0 or $m == 0 or $d == 0)
3472 0 0 if length $m == 1
3473 0 0 if length $d == 1
3474 0 0 if length $h == 1
3475 0 0 if length $mi == 1
3476 0 0 if length $s == 1
3477 0 0 unless (length $h)
3482 0 0 unless length $s
3483 0 0 if $datetype eq 'DATETIME'
3485 0 0 if $datetype eq 'DATE'
3553 0 0 if (ref $val eq 'ARRAY') { }
3559 0 0 unless length $v
3562 0 0 unless @newv
3563 0 0 @newv > 1 ? :
3568 0 0 unless length $val
3573 0 0 if (($key_pre, $key_pre2, $gname, $fname) = $key =~ /((?:__SDAT\.)?(?:SC\.)?((.*?)\.(.*?))(?:\..*?)?)\._(?:QUANT|UNIT|MONTH|YEAR|DAY|MIN|HOUR)$/) { }
0 0 elsif (($key_pre) = $key =~ /(.*)\._CONFIRM[12]$/) { }
3575 0 0 if $$new_query{$key_pre}
3580 0 0 ref $caller && ref $caller->field_hash ? :
3587 0 0 if (length $quant or length $unit)
3589 0 0 unless length $quant and length $unit and DBIx::IO::GenLib::isint($quant)
3593 0 0 if ($unit eq 'HRS') { }
0 0 elsif ($unit eq 'DAYS') { }
0 0 elsif ($unit eq 'MINS') { }
0 0 elsif ($unit eq 'MONTHS') { }
0 0 elsif ($unit eq 'YEARS') { }
3643 0 0 unless length $val
3647 0 0 if $confirm_proc{$key_pre}
3648 0 0 $$query{"$key_pre._CONFIRM1"} eq $$query{"$key_pre._CONFIRM2"} ? :
3658 0 0 if ($key =~ /(.*)\._DT$/) { }
0 0 elsif ($key =~ /((.*)\.(.*))\._CG$/) { }
3660 0 0 unless $val =~ /^\d{14}$/
3674 0 0 if (ref $caller)
3683 0 0 if $$field_attrs{'MULTI_INSERT_DELIMITER'}
3690 0 0 if ref $val eq 'ARRAY'
3730 0 0 if $@
3759 0 0 if ref $$self{$key}
3770 0 0 if ref $$group{$key}
3817 0 0 if $field =~ /\b$name\./
3845 0 0 if $field =~ /\b$name\.(.*)/
3865 0 0 unless defined $toencode
3866 0 0 if ref $self and $$self{'dontescape'}
3876 0 0 if (defined $newlinestoo and $newlinestoo)
3898 0 0 unless defined $string
3899 0 0 if ref $self and $$self{'dontunescape'}
3905 0 0 /^#x([0-9a-f]+)$/i && $latin ? :
0 0 /^#(\d+)$/ && $latin ? :
0 0 /^lt$/i ? :
0 0 /^gt$/i ? :
0 0 /^quot$/i ? :
0 0 /^amp$/i ? :