Branch Coverage

File:lib/OpenAPI/Handler/Model.pm
Coverage:75.4%

line%coveragebranch
11100TFif (not $type =~ /^ \s* ( text | integer | serial | real | double precision | date | (?:timestamp|time) (?: \s* \( \s* \d+ \s* \) )? (?: \s* with(?:out)? \s+ time \s+ zone)? | interval (?: \s* \( \s* \d+ \s* \) )? ) \s* $ /x)
3250TFif (not $res)
64100TFunless my $data = _HASH($$self{'_req_data'})
69100TFif ($model eq '~')
73100TFif ($name = delete $$data{'name'} and $name ne $model)
84100TFif ($model eq '~')
8750TFif (not $self->has_model($model))
106100TFif ($col eq '~') { }
10850TFif (not $list or not ref $list)
11450TFif (not $res or not @$res)
13150TFif ($num >= $COLUMN_LIMIT)
13550TFunless $data = _HASH $data
13650TFif ($col eq 'id')
139100TFif ($col eq '~')
146100TFif (defined $fst)
15150TFunless my $label = $$data{'label'}
159100TFif (defined $default)
170100TFif $alias and $alias ne $col
181100TFunless my $data = _HASH($$self{'_req_data'})
18650TFif (lc $col eq 'id')
193100TFif ($new_col) { }
19450TFunless _IDENT($new_col)
205100TFif ($type)
213100TFif (defined $label)
21450TFunless _STRING $label
220100TFif (defined $default)
23450TF$res ? :
244100TFif (lc $col eq 'id')
249100TFif ($col eq '~') { }
26050TF$res > -1 ? :
278100TFif ($column ne '~' and $value ne '~')
281100TFif ($column ne '~' and $value eq '~')
284100TFif ($column eq '~' and $value eq '~')
28750TFif ($column eq '~') { }
299100TFif ($value eq '~')
32650TFif ($nmodels >= $MODEL_LIMIT)
33050TFunless my $model = delete $$data{'name'}
334100TFunless my $description = delete $$data{'description'}
336100TFunless _STRING $description
34050TFif (not ref $data)
345100TFif (_HASH $columns)
346100TFif ($columns and not _ARRAY0 $columns) { }
100TFelsif (not $columns) { }
100TFelsif (not @$columns) { }
35450TFif (@$columns > $COLUMN_LIMIT)
358100TFif (%$data)
364100TFif ($self->has_model($model))
379100TFunless _HASH $col
38050TFunless my $name = delete $$col{'name'}
382100TFunless _STRING $name
383100TFunless _IDENT($name)
384100TFif (length $name >= 32)
389100TFif (lc $name eq 'id')
395100TFunless my $label = $$col{'label'}
403100TFif (defined $default)
42150TFif ($@)
425100TF$found_id ? :
43250TFif (not $expr =~ /^ \s* ( now \s* \( \s* \) (?: \s+ at \s+ time \s+ zone \s+ '[^']+' )? ) \s* $ /x)
445100TFif (_STRING($default || $default eq '0')) { }
50TFelsif (_ARRAY $default) { }
45850TFunless _IDENT($model)
475100TFif (@$rbits >= 2)
477100TFunless _IDENT($model) or $model eq '~'
478100TFif (length $model >= 32)
482100TFif (@$rbits >= 3)
485100TFunless _IDENT($col) or $col eq '~'
488100TFif ($meth eq 'POST') { }
490100TFif (@$rbits >= 3 and $model ne '~')
491100TFif (not $self->has_model($model))
498100TFif ($model and $model ne '~')
499100TFif (not $self->has_model($model))
504100TFif ($col and $col ne '~')
505100TFif ($model ne '~' and not $self->has_model_col($model, $col))
54250TFif (not $self->has_model($model))
55650TFif (not $list or not ref $list)
56450TFif (not $self->has_model($model))
57350TFif (not $list or not ref $list)
57950TFunless _IDENT($model)
580100TFunless _IDENT($col)
583100TFif $col eq 'id'
60750TFif (not ref $data)
61250TFif ($self->row_count($table) >= $RECORD_LIMIT)
62250TFif ($user eq $special_account)
631100TFif (ref $data eq 'HASH') { }
50TFelsif (ref $data eq 'ARRAY') { }
63750TF$num ? :
64150TFif (@$data > $INSERT_LIMIT)
64550TFunless _HASH $row_data
65150TF$rows_affected ? :
66350TFunless _IDENT($col)
670100TFif (not $found)
681100TFunless defined $order_by
682100TFif $order_by eq ''
684100TFif (not @sub_order_by and $order_by)
690100TFunless $self->has_model_col($model, $col)
692100TFif $dir
693100TFif $dir and $dir ne 'asc' and $dir ne 'desc'
702100TFif ($offset)
71050TFif (defined $limit)
720100TFif (lc $user_col ne 'id' and $user_col ne '~')
723100TFif ($col eq $user_col)
72550TFif (not $found)
729100TFif (defined $val and $val ne '~') { }
732100TFif ($op eq 'like')
736100TFif ($user_col eq '~') { }
75350TFif (not $res and not ref $res)
76150TFif (not $self->has_model($model))
77350TFif (not $list or not ref $list)
77950TFif (not $self->has_model($model))
78950TFif (not $self->has_model($model))
79450TFif (lc $user_col ne 'id')
7970TFif ($col eq $user_col)
7990TFif (not $found)
80350TFif (defined $val) { }
81750TFif ($user_col ne 'id' and $user_col ne '~')
8200TFif ($col eq $user_col)
8230TFif (not $found)
82550TFif (not ref $data or ref $data ne 'HASH')
831100TFif (lc $col eq 'id')
837100TFif (defined $val and $val ne '~')
842100TF$retval ? :
84750TFunless my $model = _IDENT($_[1])
84850TFunless my $data = _HASH($_[2])
85050TFif (not $self->has_model($model))
856100TFif ($new_model = delete $$data{'name'})
85750TFunless _IDENT($new_model)
85950TFif ($self->has_model($new_model))
86950TFif (my $desc = delete $$data{'description'})
87050TFunless _STRING $desc
87350TFif (%$data)