Condition Coverage

lib/DB/Object/Query.pm
Criterion Covered Total %
condition 0 432 0.0


and 2 conditions

line l !l condition
352 0 0 not wantarray and scalar @{$self->{'_extra'};}
626 0 0 %to_unixtime and scalar keys %to_unixtime
654 0 0 %avoid and scalar keys %avoid
1462 0 0 $bind and scalar @$ref

and 3 conditions

line !l l&&!r l&&r condition
108 0 0 0 $def->{'sth'} and not $self->_is_object($def->{'sth'}) || $def->{'sth'}->isa('DB::Object::Statement')
122 0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'})
0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'}) and $constant->{'sth'}->isa("DB::Object::Statement")
220 0 0 0 @$args and not @$args % 2
239 0 0 0 $value =~ /^\d+$/ and $struct->{$_} =~ /\bSET\(/i
0 0 0 $value =~ /^\d+$/ and $struct->{$_} =~ /\bENUM\(/i
0 0 0 $value =~ /^\d+$/ and $struct->{$_} =~ /\bENUM\(/i and $query_type eq 'insert' || $query_type eq 'update'
331 0 0 0 $query_type eq "select" and $prefix
366 0 0 0 not @arg and $data
378 0 0 0 @arg and scalar(@arg) % 2
382 0 0 0 $arg{'data'} and not $data
395 0 0 0 $info and scalar @$info
435 0 0 0 $value =~ /^\d+$/ and $struct->{$field} =~ /\bSET\(/i
458 0 0 0 lc $types->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
0 0 0 $self->_is_hash($value) and lc $types->{$field} eq 'jsonb' || lc $types->{$field} eq 'json'
461 0 0 0 lc $types->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
501 0 0 0 lc $types->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
518 0 0 0 lc $types->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
550 0 0 0 scalar @$arg and @$arg % 2
574 0 0 0 $query_type ne "insert" and $query_type ne "delete"
0 0 0 $query_type ne "insert" and $query_type ne "delete" and $query_type ne "replace"
577 0 0 0 $alias and %$alias
590 0 0 0 %default and %fields
595 0 0 0 $query_type eq "select" and $enhance
686 0 0 0 exists $fields{'last_name'} and exists $fields{'first_name'}
0 0 0 exists $fields{'last_name'} and exists $fields{'first_name'} and not exists $fields{'name'}
697 0 0 0 exists $default{'auth'} and not defined $arg{'auth'}
704 0 0 0 exists $default{'status'} and not defined $default{'status'}
748 0 0 0 @_ == 1 and ref $_[0]
753 0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'})
0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'}) and $constant->{'sth'}->isa("DB::Object::Statement")
758 0 0 0 not @arg and $data
0 0 0 not @arg and $data and $self->_is_hash($data)
0 0 0 $data and ref $data eq "${base_class}::Statement"
781 0 0 0 $structure->{$field} =~ /\b(AUTO_INCREMENT|SERIAL|nextval)\b/i and not $arg{$field}
784 0 0 0 scalar @arg and not exists $arg{$field}
0 0 0 scalar @arg and not exists $arg{$field} and $null->{$field}
794 0 0 0 $data and $self->_is_hash($data)
0 0 0 $data and $self->_is_hash($data) and $self->binded_types->length
837 0 0 0 $limit->metadata->offset eq "?" and $limit->metadata->limit eq "?"
875 0 0 0 $local and %$local
961 0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'})
0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'}) and $constant->{'sth'}->isa("DB::Object::Statement")
980 0 0 0 @_ == 1 && ref $_[0]
1035 0 0 0 $alias and %$alias
1040 0 0 0 exists $ok_ref->{$f} and $prefix
1093 0 0 0 $fields eq $prev_fields and @$queries
1117 0 0 0 $tie and %$tie
1186 0 0 0 @_ and @_ % 2
1210 0 0 0 @_ == 1 and ref $_[0]
1212 0 0 0 not @arg and $data
1226 0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'})
0 0 0 $constant->{'sth'} and $self->_is_object($constant->{'sth'}) and $constant->{'sth'}->isa("DB::Object::Statement")
1281 0 0 0 @_ == 1 && (!$self->_is_object($_[0]) || $self->_is_array($_[0])) && !exists($$fields_ref{"$_[0]"})
1489 0 0 0 $self->{'limit'} && $self->_is_object($self->{'limit'})
1579 0 0 0 $where and $type ne "insert"
1580 0 0 0 $group and $type eq "select"
1581 0 0 0 $order and $type eq "select"
1582 0 0 0 $sort and $order
0 0 0 $sort and $order and $type eq "select"
1583 0 0 0 $limit and $type ne "insert"
1590 0 0 0 $self->{'query'} and length $self->{'query'}
1624 0 0 0 not $type =~ /^(?:select|delete)$/ and $binded_values->length
1625 0 0 0 $where->length and $binded_where->length
1626 0 0 0 $group->length and $binded_group->length
1627 0 0 0 $order->length and $binded_order->length
1628 0 0 0 $limit->length and $binded_limit->length
1668 0 0 0 not $value =~ /[\r\n]+/ and $value =~ /\b(?:$fields)\b/ || $value =~ /\w\([^\)]*\)/ || $value eq '?'
1708 0 0 0 length $self->{$prop} and $self->_is_object($self->{$prop})
1727 0 0 0 scalar @_ == 1 && $self->_is_object($_[0])
0 0 0 @_ % 2 and not scalar @_ == 1 && $self->_is_object($_[0])
1758 0 0 0 $self->_is_object($arg[0]) and $arg[0]->isa("DB::Object::Operator")
0 0 0 $self->_is_object($arg[0]) and $arg[0]->isa("DB::Object::Query::Clause")
0 0 0 $self->_is_object($arg[0]) and $arg[0]->isa("DB::Object::Fields::Field::Overloaded")
0 0 0 scalar(@arg) % 2 and not ref $arg[0]
0 0 0 scalar(@arg) % 2 and ref $arg[0] eq "SCALAR"
0 0 0 $self->_is_a($arg[0], "DB::Object::Fields::Field") and scalar @arg == 1
1801 0 0 0 scalar @arg and $self->_is_a($arg[0], "DB::Object::Fields::Field")
1834 0 0 0 $self->_is_a($field, "DB::Object::Fields::Field") and $self->_is_a($value, "DB::Object::Fields::Field::Overloaded")
1955 0 0 0 lc $fields_type->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
1973 0 0 0 lc $fields_type->{$field} eq "bytea" and $const = $self->database_object->get_sql_type("bytea")
2049 0 0 0 $self->generic->length and $self->query_object->table_object->use_bind
2091 0 0 0 $self->_is_object($_[0]) and $_[0]->isa("DB::Object::Operator")
2094 0 0 0 $op_obj->operator ne "AND" and $op_obj->operator ne "OR"
0 0 0 $op_obj->operator ne "AND" and $op_obj->operator ne "OR" and $op_obj->operator ne "NOT"
2123 0 0 0 $self->type->length and $this->type->length
0 0 0 $self->type->length and $this->type->length and $this->type ne $self->type

or 2 conditions

line l !l condition
124 0 0 $self->table_object || (return $self->error('No table object is set.'))
125 0 0 $tbl_o->name || (return $self->error('No table to delete entries from was set.'))
145 0 0 $tbl_o->_cache_this($self) || (return $self->error("Error while preparing query to delete from table '${table}':\n$query"))
187 0 0 $self->table_object || (return $self->error('No table object is set.'))
380 0 0 $self->table_object || (return $self->error('No table object is set.'))
393 0 0 $data || \@arg
542 0 0 $self->table_object || (return $self->error('No table object is set.'))
768 0 0 $self->table_object || (return $self->error('No table object is set.'))
769 0 0 $tbl_o->name || (return $self->error('No table was provided to insert data.'))
863 0 0 $self->{'local'} ||= {}
963 0 0 $self->table_object || (return $self->error('No table object is set.'))
965 0 0 $tbl_o->qualified_name || (return $self->error('No table name provided to perform select statement.'))
1097 0 0 $_->{'selected_fields'} ||= ""
1100 0 0 $last_query[0] || {}
1188 0 0 $ref ||= \%hash
1228 0 0 $self->table_object || (return $self->error('No table object is set.'))
1229 0 0 $tbl_o->name || (return $self->error('No table to update was provided.'))
1235 0 0 $self->format_update(\@arg) || (return $self->error('No data to update was provided.'))
1247 0 0 $tbl_o->_cache_this($self) || (return $self->error("Error while preparing query to update table '${table}':\n$query"))
1269 0 0 shift @_ || (return $self->error('No clause type was provided.'))
1271 0 0 shift @_ || (return $self->error("No object data property name was provided for clause type '${type}'."))
1272 0 0 $self->table_object || (return $self->error('No table object is set.'))
1379 0 0 $self->table_object || (return $self->error('No table object is set.'))
1383 0 0 $self->{'having'} ||= ""
1486 0 0 $self->table_object || (return $self->error('No table object is set.'))
1568 0 0 lc shift @_ || $self->_query_type || (return $self->error('You must specify a query type: select, insert, update or delete'))
1607 0 0 $self->table_object || (return $self->error('No table object is set.'))
1646 0 0 $self->{'table_object'} || (return $self->error('No table object is set.'))
1702 0 0 shift @_ || (return $self->error('No clause type was provided.'))
1704 0 0 shift @_ || (return $self->error("No object data property name was provided for clause type '${type}'."))
1705 0 0 $self->table_object || (return $self->error('No table object is set.'))
1733 0 0 $_[0]->operator || (return $self->error('Unknown operator for "', $_[0], '".'))

or 3 conditions

line l !l&&r !l&&!r condition
108 0 0 0 $self->_is_object($def->{'sth'}) || $def->{'sth'}->isa('DB::Object::Statement')
143 0 0 0 $self->where or $self->database_object->allow_bulk_delete
239 0 0 0 $query_type eq 'insert' || $query_type eq 'update'
364 0 0 0 $self->_is_array($_[0]) or $self->_is_hash($_[0])
0 0 0 $self->_is_array($_[0]) or $self->_is_hash($_[0]) or @_ % 2
381 0 0 0 $arg{'default'} ||= $self->{'_default'}
400 0 0 0 $arg{'default'} || $self->{'_default'}
458 0 0 0 lc $types->{$field} eq 'jsonb' || lc $types->{$field} eq 'json'
543 0 0 0 $opts->{'table'} || $tbl_o->name
565 0 0 0 $opts->{'unixtime'} || time
0 0 0 $time ||= $opts->{'unixtime'} || time
579 0 0 0 $opts->{'avoid'} || $self->avoid
580 0 0 0 $opts->{'unix_timestamp'} || $self->unix_timestamp
581 0 0 0 $opts->{'from_unixtime'} || $self->from_unixtime
697 0 0 0 exists $default{'auth'} and not defined $arg{'auth'} or defined $arg{'auth'}
704 0 0 0 exists $default{'status'} and not defined $default{'status'} or defined $arg{'status'}
837 0 0 0 $limit->metadata->offset eq "?" and $limit->metadata->limit eq "?" or $limit->metadata->limit eq "?"
1018 0 0 0 $` =~ /\s+(?:AS|FROM)\s+$/i or not $field
1040 0 0 0 $f =~ /\b(?:$ok_list)\b/ or $f =~ /\w\([^\)]*\)/
1243 0 0 0 $self->where or $self->database_object->allow_bulk_update
1275 0 0 0 length $self->{$prop} or ref $self->{$prop}
1303 0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/
0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/ or $field eq "?"
0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/ or $field eq "?" or not $bind
1403 0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/
0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/ or $field eq "?"
0 0 0 $field =~ /\b(?:$fields)\b/ or $field =~ /\w\([^\)]*\)/ or $field eq "?" or not $bind
1665 0 0 0 $this_table ||= $table
1668 0 0 0 $value =~ /\b(?:$fields)\b/ || $value =~ /\w\([^\)]*\)/ || $value eq '?'
1845 0 0 0 not defined $value or lc $value eq "null"
1883 0 0 0 $value =~ /[\s\(\)\.\'\"]+(?:$fields)[\s\(\)\.\'\"]+/ or $value =~ /\w\([^\)]*\)/
0 0 0 $value =~ /[\s\(\)\.\'\"]+(?:$fields)[\s\(\)\.\'\"]+/ or $value =~ /\w\([^\)]*\)/ or $value eq "?"
1916 0 0 0 $self->database_object->driver eq "SQLite" or $self->database_object->driver eq "mysql"