Branch Coverage

blib/lib/LittleORM/Model.pm
Criterion Covered Total %
branch 0 316 0.0


line true false branch
30 0 0 if &__descr_attr($attr, 'do_not_clear_on_reload')
33 0 0 if ($attr->has_clearer) { }
47 0 0 if (ref $clearer) { }
80 0 0 if (my(@pk) = $self->__find_primary_keys) { }
122 0 0 if ($args{'_debug'})
132 0 0 if ($rec)
146 0 0 if ($attrname)
148 0 0 unless (exists $more{'db_field_type'})
151 0 0 if (my $t = &__descr_attr($attr, 'db_field_type'))
160 0 0 if ($attrname)
177 0 0 if ($rec)
179 0 0 if ($args{'_fieldset'} or $args{'_groupby'}) { }
183 0 0 if (my $fs = $args{'_fieldset'})
187 0 0 unless ('LittleORM::Model::Field'->this_is_field($f))
204 0 0 if (my $grpby = $args{'_groupby'})
218 0 0 if ('LittleORM::Model::Field'->this_is_field($f)) { }
231 0 0 $post_process ? :
272 0 0 unless ($r)
289 0 0 if ($args{'_debug'})
323 0 0 if ($args{'_debug'})
333 0 0 if ($args{'_groupby'}) { }
0 0 elsif ($rows == 1) { }
379 0 0 if ('LittleORM::Model::Field'->this_is_field($attrname)) { }
387 0 0 if (my $coerce_from = &__descr_attr($attr, 'coerce_from'))
406 0 0 if ('LittleORM::Model::Field'->this_is_field($attrname)) { }
414 0 0 if (my $coerce_from = &__descr_attr($attr, 'coerce_from'))
448 0 0 if ($func eq 'count')
451 0 0 if (my $d = $args{'_distinct'})
455 0 0 if (@distinct_on) { }
479 0 0 if (ref $d eq 'ARRAY') { }
484 0 0 if ('LittleORM::Model::Field'->this_is_field($aname))
523 0 0 if (my $t = $args{'_tables_to_select_from'})
530 0 0 if (my $attrname = $args{'_attr'})
532 0 0 if ('LittleORM::Model::Field'->this_is_field($attrname)) { }
562 0 0 if (my $t = $args{'_groupby'})
574 0 0 if ('LittleORM::Model::Field'->this_is_field($grp)) { }
578 0 0 if ($grp->model and $grp->model ne $self)
616 0 0 if ($args{'_debug'})
632 0 0 if ($rc == 1)
652 0 0 if ($allok)
677 0 0 if ($index_of_first_args_el_which_is_not_ref) { }
718 0 0 unless (defined $fields)
731 0 0 if ($$extra_args_data{'_debug'})
742 0 0 if ($rc == scalar @{$new_records_data;}) { }
771 0 0 if (exists $args{$aname})
777 0 0 unless (%rv)
794 0 0 if (&__get_db_field_name($attr) eq $db_field_name)
810 0 0 if (scalar @_ == 1) { }
829 0 0 if ($args{'_debug'}) { }
836 0 0 if (ref $self)
838 0 0 if ($rc != 1)
856 0 0 if (ref $self) { }
878 0 0 if ($self->__should_ignore_on_write($attr))
885 0 0 if (exists $args{$aname})
911 0 0 unless ($k =~ /^_/)
915 0 0 if ($self->__should_ignore_on_write($attr)) { }
923 0 0 if ('LittleORM::Model::Field'->this_is_field($value)) { }
925 0 0 if (my $t1 = &__descr_attr($attr, 'db_field_type') and my $t2 = $value->db_field_type)
929 0 0 unless ($t1 eq $t2)
960 0 0 if (my $w = $args{'_where'}) { }
963 0 0 if (ref $w eq 'ARRAY') { }
1005 0 0 if ($self->__should_ignore_on_write($attr))
1011 0 0 unless (exists $copied_args{$aname})
1029 0 0 if ($args{'_debug'})
1058 0 0 if ($v) { }
1085 0 0 if ($self->__should_ignore($attr) or &__descr_attr($attr, $orm_initialized_attr_desc_option) or &__descr_attr($attr, $orm_initialized_attr_desc_option_hf))
1107 0 0 $attr->has_handles ? :
1125 0 0 defined $predicate ? :
0 0 defined $trigger ? :
0 0 defined $clearer ? :
0 0 defined $handles ? :
1127 0 0 if ($orig_method and $orig_method->isa('Class::MOP::Method::Wrapped'))
1162 0 0 if (defined $coerce_from) { }
0 0 elsif (my $foreign_key = &__descr_attr($attr, 'foreign_key')) { }
1168 0 0 if ($foreign_key eq 'yes')
1179 0 0 unless ($foreign_key_attr_name)
1216 0 0 if (&__descr_attr($attr, 'ignore') or &__descr_attr($attr, 'ignore_write'))
1224 0 0 unless (exists $args{$aname})
1226 0 0 if (my $seqname = &__descr_attr($attr, 'sequence')) { }
1246 0 0 unless ($rv)
1271 0 0 if ($arg =~ /^_/)
1279 0 0 if (&__descr_attr($attr, 'ignore') or &__descr_attr($attr, 'ignore_write'))
1332 0 0 if ('LittleORM::Model::Value'->this_is_value($value))
1334 0 0 unless ($value->orm_coerce)
1341 0 0 if ($perform_coercion)
1345 0 0 if ($ftc and $ftc->has_coercion)
1353 0 0 unless ('LittleORM::Model::Field'->this_is_field($value))
1355 0 0 if ($perform_coercion and my $coerce_to = &__descr_attr($attr, 'coerce_to'))
1362 0 0 if (blessed $value and &__descr_attr($attr, 'foreign_key'))
1366 0 0 unless ($foreign_key_attr_name)
1385 0 0 if (ref $self)
1387 0 0 if (my(@pk) = $self->__find_primary_keys) { }
1418 0 0 unless ($rv)
1420 0 0 if (&__descr_attr($attr, 'primary_key') or &__descr_attr($attr, 'ignore_write'))
1436 0 0 unless ($rv)
1439 0 0 if ($aname =~ /^_/)
1445 0 0 unless ($rv)
1448 0 0 if (&__descr_attr($attr, 'ignore'))
1465 0 0 if (my $t = $args{'_groupby'})
1480 0 0 if ($self->__should_ignore($attr))
1491 0 0 if ($groupby) { }
1493 0 0 if (exists $$groupby{$aname})
1500 0 0 unless ($field_set)
1507 0 0 if ($field_set)
1511 0 0 unless ('LittleORM::Model::Field'->this_is_field($f))
1519 0 0 if ($f->model)
1548 0 0 if (my $t = $args{'_tables_to_select_from'})
1555 0 0 if (my $d = $args{'_distinct'})
1559 0 0 if (my(@distinct_on) = $self->__get_distinct_on_attrs($d)) { }
1597 0 0 if (my $t = $args{'_sortby'})
1599 0 0 if (ref $t eq 'HASH') { }
0 0 elsif (ref $t eq 'ARRAY') { }
1611 0 0 if (my $t = $self->meta->find_attribute_by_name($k))
1638 0 0 if (my $t = $self->meta->find_attribute_by_name($k)) { }
0 0 elsif ('LittleORM::Model::Field'->this_is_field($k)) { }
1665 0 0 if (my $t1 = $self->meta->find_attribute_by_name($t)) { }
0 0 elsif ('LittleORM::Model::Field'->this_is_field($t)) { }
1683 0 0 if (my $t = int($args{'_limit'} || 0))
1688 0 0 if (my $t = int($args{'_offset'} || 0))
1701 0 0 if (my $t = $args{'_groupby'})
1716 0 0 if ('LittleORM::Model::Field'->this_is_field($grp)) { }
1722 0 0 if ($grp->model and $grp->model ne $self)
1748 0 0 if (ref $val eq 'ARRAY') { }
1752 0 0 if (my $ta = $$args{'_table_alias'})
1764 0 0 if (my $ta = $$args{'_table_alias'})
1766 0 0 unless ($val->table_alias)
1793 0 0 if ($attr eq '_where') { }
0 0 elsif ($attr eq '_clause') { }
1804 0 0 if ($attr =~ /^_/)
1840 0 0 if ($op)
1844 0 0 unless (exists $args{'_include_table_alias_into_sql'} and $args{'_include_table_alias_into_sql'} == 0)
1851 0 0 if ('LittleORM::Model::Field'->this_is_field($attr))
1858 0 0 if ($val1_type and $val2_type and $val1_type ne $val2_type)
1871 0 0 unless (@where_args)
1889 0 0 unless ('LittleORM::Model::Field'->this_is_field($attr))
1894 0 0 if (&__descr_attr($class_attr, 'ignore')) { }
1904 0 0 if ($op and 'LittleORM::Model::Field'->this_is_field($attr))
1906 0 0 unless ($class_attr)
1908 0 0 if ($attr->base_attr)
1916 0 0 if (ref $val eq 'HASH') { }
0 0 elsif (ref $val eq 'ARRAY') { }
0 0 elsif ('LittleORM::Model::Field'->this_is_field($val)) { }
1918 0 0 if ($$args{'__we_do_insert_now'}) { }
1930 0 0 if (ref $rval eq 'ARRAY') { }
1949 0 0 if ($$args{'__we_do_insert_now'}) { }
1966 0 0 if (my(@values) = map({$self->__prep_value_for_db_w_field(&__prep_value_for_db($class_attr, $_), $ta, $args, $dbh);} @{$val;})) { }
1983 0 0 if ($val->model)
1985 0 0 unless ($val->model eq $self)
1994 0 0 if ('LittleORM::Model::Value'->this_is_value($val))
2014 0 0 if ('LittleORM::Model::Field'->this_is_field($v)) { }
0 0 elsif ($dbh) { }
2017 0 0 if ($v->model)
2019 0 0 unless ($v->model eq $self)
2056 0 0 if (my $pk = &__descr_attr($attr, 'primary_key'))
2070 0 0 if ($attr->can('description'))
2086 0 0 if (my $t = &__descr_attr($attr, 'db_field'))
2101 0 0 if (my $d = &__descr_or_undef($attr))
2103 0 0 if (my $t = $$d{$attr_attr_name})