Branch Coverage

blib/lib/Mongoose/Engine.pm
Criterion Covered Total %
branch 0 152 0.0


line true false branch
20 0 0 if (my $duplicate = &first(sub { &refaddr($self) == &refaddr($_); } , @scope))
23 0 0 unless defined $class and $ref_id
24 0 0 if $self->_id and $self->_id eq $ref_id
34 0 0 if (my $attr = $self->meta->get_attribute($key))
35 0 0 if $attr->does('Mongoose::Meta::Attribute::Trait::DoNotMongoSerialize')
38 0 0 if $attr->does('Mongoose::Meta::Attribute::Trait::Raw')
40 0 0 if (my $type = $attr->type_constraint)
41 0 0 if ($type->is_a_type_of('Num')) { }
0 0 elsif ($type->is_a_type_of('FileHandle')) { }
64 0 0 if (my $class = &blessed($value)) { }
0 0 elsif (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value eq 'HASH') { }
65 0 0 if (ref $value eq 'HASH' and defined(my $ref_id = $value->{'_id'}))
79 0 0 if ($aryclass and $aryclass->does('Mongoose::EmbeddedDocument')) { }
0 0 elsif ($aryclass and $aryclass->does('Mongoose::Document')) { }
99 0 0 if (&blessed($value->{$key})) { }
0 0 elsif (ref $value->{$key} eq 'ARRAY') { }
119 0 0 if ($class->can('meta')) { }
0 0 elsif (not $class =~ /^(?: DateTime(?:\:\:Tiny)? | boolean | ^BSON::)$/x) { }
120 0 0 if ($class->does('Mongoose::EmbeddedDocument')) { }
0 0 elsif ($class->does('Mongoose::Document')) { }
0 0 elsif ($class->isa('Mongoose::Join')) { }
121 0 0 unless $ret = $obj->collapse(@scope, $self)
138 0 0 if ($reftype eq 'ARRAY') { }
0 0 elsif ($reftype eq 'SCALAR') { }
0 0 elsif ($reftype eq 'HASH') { }
149 0 0 if $param_class eq 'DateTime'
151 0 0 if $param_class->does('Mongoose::EmbeddedDocument')
153 0 0 if ($param_class->does('Mongoose::Document'))
154 0 0 if (my $circ_doc = $$scope{$value->id}) { }
0 0 elsif (my $obj = $param_class->find_one({'_id', $value->id}, undef, $scope)) { }
172 0 0 unless ref $scope eq 'HASH'
175 0 0 if (ref $doc eq 'BSON::DBRef')
177 0 0 defined $$scope{$doc->id} ? :
185 0 0 unless exists $doc->{$name}
186 0 0 if $attr->does('Mongoose::Meta::Attribute::Trait::Raw')
188 0 0 unless my $type = $attr->type_constraint
189 0 0 unless my $class = $self->_get_blessed_type($type)
191 0 0 if ($type->is_a_type_of('HashRef')) { }
0 0 elsif ($type->is_a_type_of('ArrayRef')) { }
0 0 elsif ($type->is_a_type_of('DateTime')) { }
0 0 elsif ($type->is_a_type_of('FileHandle')) { }
193 0 0 if (defined $type->{'type_parameter'})
195 0 0 if (my $param_class = $param->{'class'}) { }
196 0 0 unless $doc->{$name}
208 0 0 if (defined $type->{'type_parameter'})
211 0 0 if (my $param_class = $param->{'class'}) { }
213 0 0 unless $doc->{$name}
237 0 0 if ($class->can('meta')) { }
239 0 0 if ($class->does('Mongoose::EmbeddedDocument')) { }
0 0 elsif ($class->does('Mongoose::Document')) { }
0 0 elsif ($class->isa('Mongoose::Join')) { }
243 0 0 if (ref $doc->{$name} eq 'BSON::DBRef')
245 0 0 if (my $circ_doc = $$scope{"$_id"}) { }
266 0 0 if (my $data_class = ref $data) { }
267 0 0 $data_class eq 'boolean' ? :
275 0 0 unless defined $doc
279 0 0 if (defined $attr) { }
308 0 0 unless scalar @fields
325 0 0 unless defined $doc
327 0 0 if (my $id = $self->_id) { }
332 0 0 if (ref 'Mongoose'->class_config($self)->{'pk'}) { }
350 0 0 unless ($x->_id)
355 0 0 if (@unsaved)
369 0 0 unless my $class = $type->name
371 0 0 unless defined $parent
372 0 0 if $parent eq 'Object'
380 0 0 if (ref $args) { }
0 0 elsif (my $pk = $self->_primary_key_query) { }
408 0 0 unless 'Mongoose'->class_config($self)->{'pk'}
411 0 0 if @pairs == @keys * 2
433 0 0 if (@_ == 1 and !ref($_[0]) || ref $_[0] eq 'BSON::OID') { }
434 0 0 ref $_[0] ? :
435 0 0 if (my $doc = $self->collection->find_one($query))
441 0 0 if (my $doc = $self->collection->find_one($query, $fields))
451 0 0 @_ ? :