lib/DBIx/ActiveRecord/Arel/Query/Select.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 32 / 32 CC 5 SCAR 12.5
CC
5
Cov
100%
_to_sql
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« blib/lib/DBIx/ActiveRecord/Relation.pm ↑ Summary lib/DBIx/ActiveRecord/Arel/Where.pm »
1 package DBIx::ActiveRecord::Arel::Query::Select;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base 'DBIx::ActiveRecord::Arel::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 35 ▶sub _to_sql {
Subroutine _to_sql: called CC=5 SCAR=16.1
7 35 my ($self) = @_;
8  
9 35 ▶ my $table = $self->has_join ? $self->main_table_with_alias : $self->main->table;
Branch: 1 branch
BranchTrueFalseTotal
$self->has_join ? : 16 19 35
10 35 my $sql = 'SELECT '.$self->build_select.' FROM ' . $table;
11 35 my $join = $self->build_join;
12 35 ▶ $sql .= ' '.$join if $join;
Branch: 1 branch
BranchTrueFalseTotal
if $join 16 19 35
13 35 my $where = $self->build_where;
14 35 ▶ $sql .= " WHERE $where" if $where;
Branch: 1 branch
BranchTrueFalseTotal
if $where 17 18 35
15 35 my $ops .= $self->build_options;
16 35 ▶ $sql .= " $ops" if $ops;
Branch: 1 branch
BranchTrueFalseTotal
if $ops 9 26 35
17 35 $sql;
18 }
19  
20 2 1;
« blib/lib/DBIx/ActiveRecord/Relation.pm ↑ Summary lib/DBIx/ActiveRecord/Arel/Where.pm »