lib/DBIx/ActiveRecord/Arel/Where.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 4 / 4 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 5 totaltotal 89.3% 42 / 47 CC 5 SCAR 10.4
CC
5
Cov
100%
build
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.8
« lib/DBIx/ActiveRecord/Arel/Query/Select.pm ↑ Summary lib/DBIx/ActiveRecord/Arel/Order.pm »
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
BranchTrueFalseTotal
if ($self->op eq 'IN' or $self->op eq 'NOT IN') { } 4 33 37
elsif ($self->op eq 'IS NULL' or $self->op eq 'IS NOT NULL') { } 2 31 33
Condition100%3/3
$self->op eq "IN" or $self->op eq "NOT IN"
l!l&&r!l&&!r
3133
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"
ABresult
1X1
011
000
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"
l!l&&r!l&&!r
1131
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"
ABresult
1X1
011
000
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;
« lib/DBIx/ActiveRecord/Arel/Query/Select.pm ↑ Summary lib/DBIx/ActiveRecord/Arel/Order.pm »