Condition Coverage

blib/lib/Rose/DB/Object/Metadata.pm
Criterion Covered Total %
condition 92 415 22.1


and 3 conditions

line !l l&&!r l&&r condition
439 0 0 0 $method eq 'auto' and not ref $args
467 9 0 0 $method eq 'unique_key' || $method eq 'add_unique_key' and not grep({ref $_;} @$args)
641 0 0 77 $db and not $db->supports_catalog
655 0 72 5 $db and not $db->supports_schema
751 0 0 0 @_ == 1 and ref $_[0] eq 'ARRAY'
1099 52 0 0 $methods and $add_methods
1203 0 0 219 $column->can('smart_modification') and not defined $column->{'smart_modification'}
1332 26 0 0 $methods and $add_methods
1542 6 0 0 $methods and $add_methods
1679 0 0 77 defined $table and $table =~ /\S/
1830 1 0 1 $db and $db->likes_lowercase_table_names
2049 0 0 32 $self->auto_load_related_classes and my $fclass = $foreign_key->class
2079 20 0 0 $Debug and not $args{'preserve_existing'}
2135 0 0 0 $arg->{'class'} eq $task->{'class'} and $arg->{'method'} eq $task->{'method'}
2210 0 0 0 $task->{'class'} eq $class and $task->{'method'} eq 'auto_init_foreign_keys'
2303 4926 0 0 $meta->allow_auto_initialization and $meta->has_outstanding_metadata_tasks
2325 58 0 0 $args{'name'} and $relationship->name ne $args{'name'}
2378 0 12 32 $fclass->isa('Rose::DB::Object') and $fclass->meta->is_initialized
2408 0 2 12 $map_class->isa('Rose::DB::Object') and $map_class->meta->is_initialized
2437 0 2 12 $relationship->can('foreign_key') && $relationship->foreign_key
2439 44 0 0 $Debug and not $args{'preserve_existing'}
2481 0 0 0 $rel->can('class') and $rel->class eq $class
0 0 0 $rel->can('map_class') and $rel->map_class eq $class
2491 0 0 0 $task->{'class'} eq $class and $task->{'method'} eq 'auto_init_relationships'
2599 0 0 0 $seqs and @$seqs
2718 0 0 0 defined $seq and index($seq, '.') < 0
2756 0 0 0 @_ == 1 && ref $_[0]
2813 0 0 0 $column->type =~ /^(?:big)?serial$/ and $db->use_auto_sequence_name
2827 0 0 0 exists $seqs[$i] and defined $seqs[$i]
2885 0 0 0 defined $seq and defined $implicit_schema
0 0 0 defined $seq and defined $implicit_schema and not defined $schema
4243 392 0 0 not defined $class and UNIVERSAL::isa($self, 'Rose::DB::Object::Metadata')
4251 391 0 0 $class->isa('Rose::DB::Object::Cached') and $name =~ /^(?:remember|forget(?:_all)?)$/
4367 0 3 0 @def == 1 && ref $def[0]
4383 0 2 1 not $class =~ /^Rose::DB::/ and %{"${class}::";}
4537 5 0 3 defined &Rose::DB::Object::Metadata::auto_symbol and not defined &Rose::DB::Object::Metadata::existing_symbol

or 2 conditions

line l !l condition
572 0 0 @_ > 1 ? $_[0]{'prepare_select_options'} = $_[1] : $_[0]{'prepare_select_options'} ||= {}
578 0 0 @_ > 1 ? $_[0]{'prepare_insert_options'} = $_[1] : $_[0]{'prepare_insert_options'} ||= {}
584 0 0 @_ > 1 ? $_[0]{'prepare_update_options'} = $_[1] : $_[0]{'prepare_update_options'} ||= {}
590 0 0 @_ > 1 ? $_[0]{'prepare_delete_options'} = $_[1] : $_[0]{'prepare_delete_options'} ||= {}
683 0 0 $self->{'key_column_names'} ||= [$self->primary_key_columns, $self->unique_keys_column_names]
799 76 76 $self->{'unique_keys'} ||= []
77 0 $self->{'unique_keys'} ||= []
804 120 0 +(shift())->{'unique_keys'} ||= []
805 0 0 +(shift())->{'unique_keys'} ||= []
978 0 0 $self->{'num_columns'} ||= scalar @{$self->columns_ordered;}
1105 48 4 $info->{'type'} ||= 'scalar'
1256 144 34 $self->{'relationships'} ||= {}
1257 26 0 $self->{'relationships'} ||= {}
1654 220 60 $self->{'foreign_keys'} ||= {}
1655 18 0 $self->{'foreign_keys'} ||= {}
1799 149 3 $reg->{'classes'} ||= []
2285 12 0 $foreign_key->deferred_make_method_args || {}
2548 2 0 $relationship->deferred_make_method_args || {}
2896 307 230 $self->{'column_names'} ||= [map({$_->name;} $self->columns_ordered)]
2903 0 76 $self->{'nonpersistent_column_names'} ||= [map({$_->name;} $self->nonpersistent_columns_ordered)]
2910 0 0 $self->{'nonlazy_column_names'} ||= [map({$_->name;} $self->nonlazy_columns)]
2917 0 0 $self->{'lazy_column_names'} ||= [map({$_->name;} $self->lazy_columns)]
2942 0 0 $self->{'column_names_sql'}{$db->{'id'}} ||= [map({$_->name_sql($db);} $self->columns_ordered)]
3039 1 153 $self->{'column_rw_method_names'} ||= [map({$self->column_rw_method_name($_);} $self->column_names)]
3050 0 153 $self->{'column_accessor_method_names'} ||= [map({$self->column_accessor_method_name($_);} $self->column_names)]
3061 0 76 $self->{'nonpersistent_column_accessor_method_names'} ||= [map({$self->nonpersistent_column_accessor_method_name($_);} $self->nonpersistent_column_names)]
3072 0 0 $self->{'nonlazy_column_accessor_method_names'} ||= [map({$self->column_accessor_method_name($_);} $self->nonlazy_column_names)]
3083 0 153 $self->{'column_mutator_method_names'} ||= [map({$self->column_mutator_method_name($_);} $self->column_names)]
3094 0 0 $self->{'nonpersistent_column_mutator_method_names'} ||= [map({$self->nonpersistent_column_mutator_method_name($_);} $self->nonpersistent_column_names)]
3105 0 0 $self->{'nonlazy_column_mutator_method_names'} ||= [map({$self->column_mutator_method_name($_);} $self->nonlazy_column_names)]
3116 0 0 $self->{'column_db_value_hash_keys'} ||= {map({$_->mutator_method_name, $_->db_value_hash_key;} $self->columns_ordered)}
3127 0 0 $self->{'nonlazy_column_db_value_hash_keys'} ||= {map({$_->mutator_method_name, $_->db_value_hash_key;} $self->nonlazy_columns)}
3138 0 0 $self->{'primary_key_column_db_value_hash_keys'} ||= [map({$_->db_value_hash_key;} $self->primary_key_columns)]
3674 0 0 $obj->{'__xrdbopriv_modified_columns'} || {}
3946 0 0 $obj->{'__xrdbopriv_modified_columns'} || {}

or 3 conditions

line l !l&&r !l&&!r condition
233 0 99 0 $Objects{$class} ||= (shift())->SUPER::new(@_)
257 9 3 0 $self_or_class->_object_default_manager_base_class(@_) || ref($self_or_class)->_class_default_manager_base_class
356 0 0 0 $_[0]{'error_mode'} ||= $_[0]->init_error_mode
382 0 0 0 $mode eq 'croak' or $mode eq 'fatal'
432 0 0 9 $method eq 'auto_initialize' or $method eq 'auto'
467 0 0 9 $method eq 'unique_key' || $method eq 'add_unique_key'
596 0 0 0 @_ > 1 ? $_[0]{'prepare_bulk_delete_options'} = $_[1] : $_[0]{'prepare_bulk_delete_options'} ||= $_[0]->prepare_delete_options
603 0 0 0 @_ > 1 ? $_[0]{'prepare_bulk_update_options'} = $_[1] : $_[0]{'prepare_bulk_update_options'} ||= $_[0]->prepare_update_options
624 82 89 0 $_[0]{'table'} ||= $_[0]->convention_manager->auto_table_name
642 0 0 0 $self->{'catalog'} || ($db ? $db->catalog : undef)
656 0 0 72 $self->{'schema'} || ($db ? $db->schema : undef)
1147 0 0 52 $methods or $add_methods
1152 0 0 0 $methods || $add_methods
1347 0 0 26 $methods or $add_methods
1352 0 0 0 $methods || $add_methods
1398 26 0 0 $self->convention_manager->auto_relationship($name, $relationship_class, $info) || $relationship_class->new(%$info, 'name', $name)
1549 6 0 0 $self->convention_manager->auto_foreign_key($name, $info) || 'Rose::DB::Object::Metadata::ForeignKey'->new(%$info, 'name', $name)
1556 0 0 6 $methods or $add_methods
1561 0 0 0 $methods || $add_methods
1756 0 1 75 $db->registration_schema || $self->select_schema($db)
1814 1 1 0 ref $self || $self_or_class
1843 1 1 0 $$reg{join $;, 'catalog-schema-table', $catalog, $schema, $table} || $$reg{join $;, 'catalog-schema-table', $catalog, $default_schema, $table} || ($schema eq "\000" && $default_schema eq "\000" ? $$reg{join $;, 'lc-table', $table} : undef)
1854 0 0 0 $$reg{join $;, 'lc-catalog-schema-table', $catalog, $schema, $table} || $$reg{join $;, 'lc-catalog-schema-table', $catalog, $default_schema, $table} || ($schema eq "\000" && $default_schema eq "\000" ? $$reg{join $;, 'lc-table', $table} : undef)
2034 64 0 0 $foreign_key->method_name($type) || $foreign_key->build_method_name_for_type($type) || Carp::croak(q[No method name defined for foreign key '], $foreign_key->name, "' method type '${type}'")
2067 0 0 0 $error =~ /\.pm in \@INC/ or UNIVERSAL::isa($error, 'Rose::DB::Object::Exception::ClassNotReady')
2230 0 0 0 $self->has_deferred_foreign_keys or $self->has_deferred_relationships
0 0 0 $self->has_deferred_foreign_keys or $self->has_deferred_relationships or $self->has_deferred_tasks
2330 134 0 0 $relationship->method_name($type) || $relationship->build_method_name_for_type($type) || Carp::croak(q[No method name defined for relationship '], $relationship->name, "' method type '${type}'")
2347 0 0 0 $preserve_existing_arg || $self->allow_auto_initialization
2395 12 0 0 $error =~ /\.pm in \@INC/ or UNIVERSAL::isa($error, 'Rose::DB::Object::Exception::ClassNotReady')
2425 2 0 0 $error =~ /\.pm in \@INC/ or UNIVERSAL::isa($error, 'Rose::DB::Object::Exception::ClassNotReady')
2481 0 0 0 $rel->can('class') and $rel->class eq $class or $rel->can('map_class') and $rel->map_class eq $class
2697 0 0 0 $args{'db'}{'id'} || ($self->{'db_id'} ||= $self->init_db_id)
2876 0 0 0 $error or not $col_info
2926 0 0 0 $self->{'nonlazy_column_names_string_sql'}{$db->{'id'}} ||= join(', ', map({$_->name_sql($db);} $self->nonlazy_columns))
2934 0 0 0 $self->{'column_names_string_sql'}{$db->{'id'}} ||= join(', ', map({$_->name_sql($db);} $self->columns_ordered))
2952 0 0 0 $self->{'select_nonlazy_columns_string_sql'}{$db->{'id'}} ||= join(', ', @{scalar $self->select_nonlazy_columns_sql($db);})
2960 0 0 0 $self->{'select_columns_string_sql'}{$db->{'id'}} ||= join(', ', @{scalar $self->select_columns_sql($db);})
3185 241 370 129 $_[0]{'column_accessor_method'}{$_[1]} ||= $_[0]->column($_[1]) ? $_[0]->column($_[1])->accessor_method_name : undef
3191 0 0 0 $_[0]{'nonpersistent_column_accessor_method'}{$_[1]} ||= $_[0]->nonpersistent_column($_[1]) ? $_[0]->nonpersistent_column($_[1])->accessor_method_name : undef
3223 236 186 81 $_[0]{'column_mutator_method'}{$_[1]} ||= $_[0]->column($_[1]) ? $_[0]->column($_[1])->mutator_method_name : undef
3229 0 0 0 $_[0]{'nonpersistent_column_mutator_method'}{$_[1]} ||= $_[0]->nonpersistent_column($_[1]) ? $_[0]->nonpersistent_column($_[1])->mutator_method_name : undef
3237 0 369 0 $_[0]{'column_rw_method'}{$_[1]} ||= $_[0]->column($_[1])->rw_method_name
3247 0 1 0 $self->{'fq_table_sql'}{$db->{'id'}} ||= join('.', grep({defined $_;} $self->select_catalog($db), $self->select_schema($db), $db->auto_quote_table_name($self->table)))
3256 0 0 0 $self->{'fq_table_sql'}{$db->{'id'}} ||= join('.', grep({defined $_;} $self->select_catalog($db), $self->select_schema($db), $db->quote_table_name($self->table)))
3265 0 0 0 $self->{'fq_table'}{$db->{'id'}} ||= join('.', grep({defined $_;} $self->select_catalog($db), $self->select_schema($db), $self->table))
3274 0 0 0 $key_columns ||= $self->primary_key_column_names
3282 0 0 0 $self->{'load_all_sql'}{$db->{'id'}}{join "\000", @$key_columns} ||= 'SELECT ' . $self->select_columns_string_sql($db) . ' FROM ' . $self->fq_table_sql($db) . ' WHERE ' . join(' AND ', map({my $c = $self->column($_); ($self->sql_qualify_column_names_on_load ? $db->auto_quote_column_with_table($c->name_sql, $self->table) : $c->name_sql($db)) . ' = ' . $c->query_placeholder_sql($db);} @$key_columns))
3295 0 0 0 $key_columns ||= $self->primary_key_column_names
3303 0 0 0 $self->{'load_sql'}{$db->{'id'}}{join "\000", @$key_columns} ||= 'SELECT ' . $self->select_nonlazy_columns_string_sql($db) . ' FROM ' . $self->fq_table_sql($db) . ' WHERE ' . join(' AND ', map({my $c = $self->column($_); ($self->sql_qualify_column_names_on_load ? $db->auto_quote_column_with_table($c->name_sql, $self->table) : $c->name_sql($db)) . ' = ' . $c->query_placeholder_sql($db);} @$key_columns))
3359 0 0 0 $key_columns ||= $self->primary_key_column_names
3391 0 0 0 $key_columns ||= $self->primary_key_column_names
3398 0 0 0 not $_->lazy or $obj->{'__xrdbopriv_lazy_loaded'}{$_->name}
3424 0 0 0 $self->{'update_sql_prefix'}{$db->{'id'}} || $self->init_update_sql_prefix($db)
3443 0 0 0 $key_columns ||= $self->primary_key_column_names
3466 0 0 0 $self->{'update_sql_prefix'}{$db->{'id'}} ||= 'UPDATE ' . $self->fq_table_sql($db) . " SET \n"
3541 0 0 0 $key_columns ||= $self->primary_key_column_names
3550 0 0 0 not $_->{'lazy'} or $obj->{'__xrdbopriv_lazy_loaded'}{$_->{'name'}}
3583 0 0 0 $self->{'update_sql_with_inlining_start'}{$db->{'id'}} || $self->init_update_sql_with_inlining_start($db)
3605 0 0 0 $key_columns ||= $self->primary_key_column_names
3649 0 0 0 $self->{'update_sql_with_inlining_start'}{$db->{'id'}} ||= 'UPDATE ' . $self->fq_table_sql($db) . " SET \n"
3665 0 0 0 $self->{'insert_sql'}{$db->{'id'}} ||= 'INSERT INTO ' . $self->fq_table_sql($db) . "\n(\n" . join(",\n", map({" $_";} $self->column_names_sql($db))) . "\n)\nVALUES\n(\n" . $self->insert_columns_placeholders_sql($db) . "\n)"
3702 0 0 0 $self->{'insert_changes_only_sql_prefix'}{$db->{'id'}} || $self->init_insert_changes_only_sql_prefix($db)
3718 0 0 0 $self->{'insert_columns_placeholders_sql'}{$db->{'id'}} ||= join(",\n", map({' ' . $_->insert_placeholder_sql($db);} $self->columns_ordered))
3774 0 0 0 not $_->{'lazy'} or $obj->{'__xrdbopriv_lazy_loaded'}{$_->{'name'}}
3834 0 0 0 $self->{'insert_sql_with_inlining_start'}{$db->{'id'}} || $self->init_insert_sql_with_inlining_start($db)
3900 0 0 0 not $_->{'lazy'} or $obj->{'__xrdbopriv_lazy_loaded'}{$_->{'name'}}
4009 0 0 0 $self->{'delete_sql'}{$db->{'id'}} ||= 'DELETE FROM ' . $self->fq_table_sql($db) . ' WHERE ' . join(' AND ', map({$_->name_sql($db) . ' = ' . $_->query_placeholder_sql($db);} $self->primary_key_columns))
4020 0 0 0 $self->{'get_column_sql_tmpl'}{$db->{'id'}} || $self->init_get_column_sql_tmpl($db)
4038 0 0 0 $Debug or $Rose::DB::Object::Debug
4123 0 0 0 $args{'db'} || $self->class->init_db
4245 0 0 0 $class ||= $self->class
4251 1 0 391 $name =~ /^(?:meta|dbh?|_?init_db|error|not_found|load|save|update|insert|delete|DESTROY)$/ or $class->isa('Rose::DB::Object::Cached') and $name =~ /^(?:remember|forget(?:_all)?)$/
4268 194 0 0 $self->column($column_name) || $self->nonpersistent_column($column_name)
4280 10 184 0 $column->method_name($method_type) || $self->convention_manager->auto_column_method_name($method_type, $column, $default_name, $self->class) || $default_name
4354 0 3 0 $args{'base_name'} ||= $self->convention_manager->auto_manager_base_name
4355 0 3 0 $args{'class'} ||= $self->convention_manager->auto_manager_class_name
4462 0 0 0 $self->auto_helper_classes->{$db->driver} || $self->auto_helper_classes->{'generic'} || Carp::croak(q[Don't know how to auto-initialize using driver '], $db->driver, q['])
4476 1 0 0 ref $self || $self