| 1 | package DBIx::ActiveRecord::Arel::Where; | ||||||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||||||
| 5 | 37 | ▶ | sub new { | ||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 6 | 37 | my ($self, $operator, $column, $value) = @_; | |||||||||||||||||||||||||||||||
| 7 | 37 | bless {op => $operator, column => $column, value => $value}, $self; | |||||||||||||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 173 | ▶ | sub op {shift->{op}} | ||||||||||||||||||||||||||||||
|
Subroutine
op: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 11 | 37 | ▶ | sub column_name {shift->{column}->name} | ||||||||||||||||||||||||||||||
|
Subroutine
column_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 12 | 70 | ▶ | sub value {shift->{value}} | ||||||||||||||||||||||||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | 37 | ▶ | sub build { | ||||||||||||||||||||||||||||||
|
Subroutine
build: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 15 | 37 | my $self = shift; | |||||||||||||||||||||||||||||||
| 16 | 37 | my $where; | |||||||||||||||||||||||||||||||
| 17 | my @binds; | ||||||||||||||||||||||||||||||||
| 18 | 37 | ▶ | if ($self->op eq 'IN' || $self->op eq 'NOT IN') { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
$self->op eq "IN" or $self->op eq "NOT IN"
MC/DC100%2/2
$self->op eq "IN" or $self->op eq "NOT IN"
$self->op eq "IN"
$self->op eq "NOT IN"
Truth table100%3/3
A or B
A= $self->op eq "IN"B= $self->op eq "NOT IN"
| |||||||||||||||||||||||||||||||||
| 19 | 4 | $where = $self->column_name.' '.$self->op.' ('.$self->value->placeholder.')'; | |||||||||||||||||||||||||||||||
| 20 | 4 | push @binds, $self->value->binds; | |||||||||||||||||||||||||||||||
| 21 | ▶ | } elsif ($self->op eq 'IS NULL' || $self->op eq 'IS NOT NULL') { | |||||||||||||||||||||||||||||||
|
Condition100%3/3
$self->op eq "IS NULL" or $self->op eq "IS NOT NULL"
MC/DC100%2/2
$self->op eq "IS NULL" or $self->op eq "IS NOT NULL"
$self->op eq "IS NULL"
$self->op eq "IS NOT NULL"
Truth table100%3/3
A or B
A= $self->op eq "IS NULL"B= $self->op eq "IS NOT NULL"
| |||||||||||||||||||||||||||||||||
| 22 | 2 | $where = $self->column_name.' '.$self->op; | |||||||||||||||||||||||||||||||
| 23 | } else { | ||||||||||||||||||||||||||||||||
| 24 | 31 | $where = $self->column_name.' '. $self->op.' '.$self->value->placeholder; | |||||||||||||||||||||||||||||||
| 25 | 31 | push @binds, $self->value->binds; | |||||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||||||
| 27 | 37 | return ($where, \@binds); | |||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | 2 | 1; | |||||||||||||||||||||||||||||||