Condition Coverage

lib/DB/Object.pm
Criterion Covered Total %
condition 11 394 2.7


and 3 conditions

line !l l&&!r l&&r condition
177 0 0 0 exists $attr{$name} and defined $value
0 0 0 exists $attr{$name} and defined $value and $attr{$name}
231 0 0 0 $self->{'cache'} and @$queries
450 0 0 0 $self->_is_object($qo) and $qo->isa("DB::Object::Query")
463 0 0 0 $self->_is_object($def->{'query_object'}) and $def->{'query_object'}->isa("DB::Object::Query")
622 0 0 0 defined $self->{'sth'} and $self->{'sth'}->errstr
0 0 0 defined $self->{'dbh'} and $self->{'dbh'}->errstr
690 0 0 0 $where and @$binded_where
695 0 0 0 $group and @$binded_group
700 0 0 0 $order and @$binded_order
705 0 0 0 $limit and @$binded_limit
761 0 0 0 $type eq "AUTOCOMMIT" and $self->{'dbh'}
0 0 0 $type eq "AUTOCOMMIT" and $self->{'dbh'} and $value =~ /^(?:1|0)$/
806 0 0 0 $sth && $sth->execute
825 0 0 0 ref $q and $q->isa("DB::Object::Query")
873 0 0 0 ref $q and $q->isa("DB::Object::Query")
923 0 0 0 $sth and not $result = $sth->execute
1157 0 0 0 @_ and $self->_is_hash($_[-1])
1194 0 0 0 @_ and $self->_is_hash($_[0])
1317 0 0 0 ref $q && $q->isa('DB::Object::Query')
1332 0 0 0 $DB::Object::CACHE_SIZE > 0 and $cache_size > $DB::Object::CACHE_SIZE
1341 0 0 0 $query and $obj->{'query'}
0 0 0 $query and $obj->{'query'} and $obj->{'query'} eq $query
1364 0 0 0 $q and $self->_is_a($q, "DB::Object::Query")
1401 0 0 0 $q and $self->_is_object($q)
0 0 0 $q and $self->_is_object($q) and $q->isa("DB::Object::Query")
1427 0 0 0 length $param->{$k} and not grep(/^$k$/, @$valid)
0 0 0 length $param->{$k} and not grep(/^$k$/, @$valid) and not exists $opts->{$k}
1435 0 0 0 not length $param->{'database'} and $param->{'db'}
1454 0 0 0 $param->{'opt'} and $self->_is_hash($param->{'opt'})
1500 0 0 0 $ENV{$equi->{$prop}} and not length $param->{$prop}
1514 0 0 0 not $@ and $uri
1537 0 0 0 not $param->{'login'} and $param->{'user'}
1612 0 0 0 not $param->{'database'} and !$driver || $this->{'driver'} eq $driver
0 0 0 $param->{'database'} and $this->{'database'} eq $param->{'database'}
0 0 0 $param->{'database'} and $this->{'database'} eq $param->{'database'} and !$param->{'host'} || $param->{'host'} eq $this->{'host'}
0 0 0 $param->{'database'} and $this->{'database'} eq $param->{'database'} and !$param->{'host'} || $param->{'host'} eq $this->{'host'} and !$param->{'port'} || $param->{'port'} eq $this->{'port'}
1634 0 0 0 not length $param->{$k} and length $ref->{$k}
1638 0 0 0 exists $param->{'host'} and index($param->{'host'}, ":") != -1
1643 0 0 0 not $param->{'opt'} and $ENV{'DB_OPT'}
1746 0 0 0 scalar @_ == 1 and not defined $_[0]
1881 0 0 0 $self->{'query'} and length $self->{'query'}
1898 1 0 0 $obj and $obj->join_tables->length > 0
1911 1 0 0 defined $self->{'bind'} and $self->{'bind'} > 1
1912 1 0 0 defined $self->{'cache'} and $self->{'cache'} > 1
1953 0 0 0 $class eq $base_class and not scalar @_
0 0 0 $class eq $base_class and not scalar @_ and $self->table_exists($meth)
0 0 0 $self and $self->can($meth)
0 0 0 $self and $self->can($meth) and defined &{"${class}::$meth";}
2041 0 0 0 $self and exists $self->{'sth'}
0 0 0 $self and $self->{'dbh'} && $self->{'dbh'}->can($meth) || defined &{'DBI::db::' . $meth;}
0 0 0 $self and $self->{'dbh'}
0 0 0 $self and $self->{'dbh'} and exists $self->{'dbh'}{$meth}
2096 1 0 0 $self->{'dbh'} and $class =~ /^AI\:\:DB(?:\:\:(?:Postgres|Mysql|SQLite))?$/
2114 1 0 0 $locks and $self->_is_array($locks)
2141 0 0 0 scalar @_ == 1 && ref $_[0] eq 'ARRAY'
2176 0 0 0 &Scalar::Util::blessed($elem) and $elem->isa("DB::Object::Statement")
2203 0 0 0 &Scalar::Util::blessed($val) && $val->isa('DB::Object::Fields::Field')
2248 0 0 0 &Scalar::Util::blessed($elem) and $elem->isa("DB::Object::Statement")
2275 0 0 0 &Scalar::Util::blessed($val) && $val->isa('DB::Object::Fields::Field')
2299 0 0 0 scalar @_ == 1 && ref $_[0] eq 'ARRAY'
2343 0 0 0 &Scalar::Util::blessed($elem) and $elem->isa("DB::Object::Statement")
2370 0 0 0 &Scalar::Util::blessed($val) && $val->isa('DB::Object::Fields::Field')
2446 0 0 2 defined $$str and length $$str

or 2 conditions

line l !l condition
277 0 0 shift @_ || (return $self->error('No name for this query cache was provided.'))
284 0 0 shift @_ || (return $self->error('No name for this query cache was provided.'))
285 0 0 shift @_ || (return $self->error('No statement handler was provided.'))
294 0 0 shift @_ || (return $self->error('No SQL driver provided to check'))
318 0 0 $that->_connection_params2hash(@_) || (return $this->error('No valid connection parameters found'))
346 0 0 $driver_class->new || die("Cannot get object from package $driver_class\n")
352 0 0 $self->_check_connect_param($param) || (return $self->pass_error)
387 0 0 $self->_dbi_connect || (return $self->pass_error)
403 0 0 $self->{'host'} || 'localhost'
404 0 0 $self->{'port'} || 0
492 0 0 $self->{'driver'} || (return $self->error('No driver to to use to check for data sources.'))
568 0 0 shift @_ || undef()
569 0 0 shift @_ || []
570 0 0 $self->{'dbh'} || (return $self->error('Could not find database handler.'))
571 0 0 $dbh->prepare($query, $opt_ref) || (return $self->error("Error while preparing do query:\n$query", $dbh->errstr))
740 0 0 $self->{'params'} ||= {}
774 0 0 $self->{'dbh'} || (return $self->error('Could not find database handler.'))
776 0 0 $dbh->prepare($query) || (return $self->error(q[Unable to set options '], join(', ', @query), q[']))
822 0 0 shift @_ || undef()
835 0 0 $dbo->_dbi_connect || (return)
859 0 0 $@ || $self->{'dbh'}->errstr || 'Unknown error while cache preparing query.'
870 0 0 shift @_ || undef()
883 0 0 $dbo->_dbi_connect || (return)
912 0 0 $@ || $self->{'dbh'}->errstr || 'Unknown error while cache preparing query.'
1050 0 0 shift @_ || (return $self->error('You must provide a table name to access the table methods.'))
1054 0 0 $self->{'server'} // ""
1055 0 0 $self->{'database'} // ""
1073 0 0 $table_class->new($table, %$hash) || (return $self->pass_error($table_class->error))
1106 0 0 shift @_ || (return $self->error('You must provide a table name to access the table methods.'))
1120 0 0 $self->table_info($table) || (return)
1134 0 0 shift @_ || (return $self->error('No table provided to add to our cache.'))
1135 0 0 $self->tables_info || (return)
1181 0 0 $self->tables_info || (return)
1211 0 0 $self->tables_info || (return)
1257 0 0 $base_class->connect($db) || (return $self->error("Unable to connect to database '${db}'."))
1273 0 0 $self->{'variables'} ||= {}
1276 0 0 $self->prepare('SHOW VARIABLES') || (return $self->error('SHOW VARIABLES is not supported.'))
1762 0 0 shift @_ || {}
1819 0 0 shift @_ || (return $self->error('No query object was provided'))
1857 1 0 $self->_query_object_create || (return $self->pass_error)
1870 0 0 shift @_ || (return $self->error('No query object was provided'))

or 3 conditions

line l !l&&r !l&&!r condition
72 0 3 0 ref $that || $that
190 0 0 0 ref $self || $self
312 0 0 0 ref $this || $this
489 0 0 0 ref $self || $self
624 0 0 0 $DBI::errstr || $DB::Object::DB_ERRSTR
759 0 0 0 not defined $value or $value eq ""
820 0 0 0 ref $self || $self
832 0 0 0 $self->{'dbo'} || $self
868 0 0 0 ref $self || $self
880 0 0 0 $self->{'dbo'} || $self
944 0 0 16 not defined $str or uc $str eq "NULL"
963 0 0 0 $vars ||= $self->local
1155 0 0 0 shift @_ || $self->database
1160 0 0 0 $opts->{'no_cache'} or $opts->{'live'}
1170 0 0 0 $cache_tables->get({'host', $self->host, 'driver', $self->driver, 'port', $self->port, 'database', $db}) || do {
1179 0 0 0 $opts->{'no_cache'} or $opts->{'live'}
0 0 0 $opts->{'no_cache'} or $opts->{'live'} or not scalar @$all
1210 0 0 0 shift @_ || $self->database
1371 0 0 0 $self->prepare($query, $prepare_options) || do {
1378 0 0 0 $self->prepare($query) || do {
1506 0 0 0 $param->{'uri'} or $ENV{'DB_CON_URI'}
1512 0 0 0 $param->{'uri'} || $ENV{'DB_CON_URI'}
1559 0 0 0 $param->{'conf_file'} or $param->{'config_file'}
0 0 0 $param->{'conf_file'} or $param->{'config_file'} or $ENV{'DB_CON_FILE'}
1561 0 0 0 delete $param->{'conf_file'} || delete $param->{'config_file'} || $ENV{'DB_CON_FILE'}
1612 0 0 0 !$driver || $this->{'driver'} eq $driver
0 0 0 !$param->{'host'} || $param->{'host'} eq $this->{'host'}
0 0 0 !$param->{'port'} || $param->{'port'} eq $this->{'port'}
1739 0 0 0 ref $self || $self
1746 0 0 0 not scalar @_ or scalar @_ == 1 and not defined $_[0]
1925 0 0 0 &blessed($_[0]) or index($_[0], "::") != -1
1929 0 0 0 ref $self || $self
2041 0 0 0 $self->{'dbh'} && $self->{'dbh'}->can($meth) || defined &{'DBI::db::' . $meth;}
2095 1 0 0 ref $self || $self
2142 0 0 0 ref $that || $that
2203 0 0 0 $val eq '?' || $self->_is_number($val)
2275 0 0 0 $val eq '?' || $self->_is_number($val)
2300 0 0 0 ref $that || $that
2370 0 0 0 $val eq '?' || $self->_is_number($val)
2420 0 43 0 ref $that || $that