Fey/Types/Internal.pm

filter: Statementstmt 98.1% 105 / 107 Branchbran 69.0% 29 / 42 Conditioncond 64.8% 70 / 108 MC/DCmcdc 17.6% 9 / 51 Subroutinesub 94.4% 34 / 36 Podpod n/a totaltotal 71.8% 247 / 344 CC 57 SCAR 17.4
CC
57
Cov
79%
__ANON__
13.1
__ANON__
13.0
__ANON__
8.4
CRAP 5.7
« Fey/SQL/Fragment/Where/Comparison.pm ↑ Summary Fey/Schema.pm »
1 package Fey::Types::Internal;
2  
3 29 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 29 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 29 our $VERSION = '0.44';
7  
8 29 ▶use List::AllUtils qw( all );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 29 ▶use overload ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 29 ▶use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 29 ▶use MooseX::Types -declare => [
Subroutine BEGIN: called CC=1 SCAR=0.0
13 qw(
14 ArrayRefOfColumns
15 ArrayRefOfFunctionArgs
16 CanQuote
17 Column
18 ColumnLikeOrName
19 ColumnOrName
20 ColumnWithTable
21 DefaultValue
22 FunctionArg
23 FK
24 GenericTypeName
25 GroupByElement
26 IntoElement
27 LiteralTermArg
28 Named
29 NamedObjectSet
30 NonNullableInsertValue
31 NonNullableUpdateValue
32 NullableInsertValue
33 NullableUpdateValue
34 OrderByElement
35 OuterJoinType
36 PosInteger
37 PosOrZeroInteger
38 SelectElement
39 SetOperationArg
40 Schema
41 Table
42 TableLikeOrName
43 TableOrName
44 WhereBoolean
45 WhereClause
46 WhereClauseSide
47 )
48 29 ];
49  
50 use MooseX::Types::Moose
51 29 ▶ qw( ArrayRef Defined Int Item Object Str Undef Value );
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 2 ▶subtype GenericTypeName, as Str, where {
Subroutine __ANON__: called CC=1 SCAR=0.0
54 2 /^(?:text|blob|integer|float|date|datetime|time|boolean|other)$/xism
55 29 };
56  
57 56 ▶subtype PosInteger, as Int, where { $_ > 0 };
Subroutine __ANON__: called CC=1 SCAR=0.0
58  
59 52 ▶subtype PosOrZeroInteger, as Int, where { $_ >= 0 };
Subroutine __ANON__: called CC=1 SCAR=0.0
60  
61 29 role_type DefaultValue, { role => 'Fey::Role::IsLiteral' };
62  
63 coerce DefaultValue,
64 1 ▶ from Undef, via { Fey::Literal::Null->new() },
Subroutine __ANON__: called CC=1 SCAR=0.0
65 101 ▶ from Value, via { Fey::Literal->new_from_scalar($_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
66  
67 29 class_type NamedObjectSet, { class => 'Fey::NamedObjectSet' };
68  
69 29 class_type Column, { class => 'Fey::Column' };
70  
71 509 ▶subtype ArrayRefOfColumns, as ArrayRef [Column], where {
Subroutine __ANON__: called CC=1 SCAR=0.0
72 509 @{$_} >= 1
73 29 };
74  
75 13 ▶coerce ArrayRefOfColumns, from Column, via { [$_] };
Subroutine __ANON__: called CC=1 SCAR=0.0
76  
77 29 role_type Named, { role => 'Fey::Role::Named' };
78  
79 subtype FunctionArg, as Object,
80 29 ▶ where { $_->can('does') && $_->does('Fey::Role::Selectable') };
Subroutine __ANON__: called CC=2 SCAR=7.2
Branch: 1 branch
BranchTrueFalseTotal
$_->can("does") and $_->does("Fey::Role::Selectable") 29 0 29
81  
82 coerce FunctionArg,
83 0 ▶ from Undef, via { Fey::Literal::Null->new() },
Subroutine __ANON__: not called CC=1 SCAR=6.9
84 2 ▶ from Value, via { Fey::Literal->new_from_scalar($_) };
Subroutine __ANON__: called CC=1 SCAR=0.0
85  
86 29 subtype ArrayRefOfFunctionArgs, as ArrayRef [FunctionArg];
87  
88 1 ▶coerce ArrayRefOfFunctionArgs, from ArrayRef, via {
Subroutine __ANON__: called CC=1 SCAR=0.0
89 1 [ map { FunctionArg->coerce($_) } @{$_} ];
90 29 };
91  
92 26 ▶subtype LiteralTermArg, as ArrayRef, where {
Subroutine __ANON__: called CC=3 SCAR=11.3
93 26 ▶ return unless $_ and @{$_};
Branch: 1 branch
BranchTrueFalseTotal
unless $_ and @{$_;} 0 26 26
Condition33%1/3
$_ and @{$_;}
!ll&&!rl&&r
0026
MC/DC0%0/2
$_ and @{$_;}
$_ @{$_;}
Truth table33%1/3
A and B
A= $_B= @{$_;}
ABresult
0X0
100
111
94 32 ▶ all {
Subroutine __ANON__: called CC=4 SCAR=13.9
95 32 ▶ blessed($_)
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 8 24 32
Condition83%5/6
$_->can("sql_or_alias") or overload::Overloaded($_)
l!l&&r!l&&!r
422
defined $_ and not ref $_
!ll&&!rl&&r
0222
MC/DC100%2/2
$_->can("sql_or_alias") or overload::Overloaded($_)
$_->can("sql_or_alias") overload::Overloaded($_)
MC/DC50%1/2
defined $_ and not ref $_
defined $_ not ref $_
Truth table100%3/3
A or B
A= $_->can("sql_or_alias")B= overload::Overloaded($_)
ABresult
1X1
011
000
Truth table66%2/3
A and not(B)
A= defined $_B= not ref $_
ABresult
0X0
100
111
96 ? $_->can('sql_or_alias') || overload::Overloaded($_)
97 : defined && !ref;
98 }
99 26 @{$_};
100 29 };
101  
102 0 ▶coerce LiteralTermArg, from Value, via { [$_] };
Subroutine __ANON__: not called CC=1 SCAR=1.2
103  
104 29 for my $thing (
105 [ 'Table', 'Fey::Table', TableOrName, TableLikeOrName ],
106 [ 'Column', 'Fey::Column', ColumnOrName, ColumnLikeOrName ]
107 ) {
108 58 my ( $thing, $class, $name_type, $like_type ) = @$thing;
109  
110 775 ▶ subtype $name_type, as Item, where {
Subroutine __ANON__: called CC=3 SCAR=11.1
111 775 ▶ return unless defined $_;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 775 775
112 775 ▶ return 1 unless blessed $_;
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($_) 53 722 775
113 722 return $_->isa($class);
114 58 };
115  
116 20 ▶ subtype $like_type, as Item, where {
Subroutine __ANON__: called CC=5 SCAR=17.5
117 20 ▶ return unless defined $_;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 20 20
118 20 ▶ return 1 unless blessed $_;
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($_) 9 11 20
119 11 ▶ return unless $_->can('does');
Branch: 1 branch
BranchTrueFalseTotal
unless $_->can("does") 0 11 11
120 11 ▶ return $_->can('does') && $_->does( 'Fey::Role::' . $thing . 'Like' );
Condition33%1/3
$_->can('does') && $_->does('Fey::Role::' . $thing . 'Like')
!ll&&!rl&&r
0011
MC/DC0%0/2
$_->can('does') && $_->does('Fey::Role::' . $thing . 'Like')
$_->can('does') $_->does('Fey::Role::' . $thing . 'Like')
Truth table33%1/3
A && B
A= $_->can('does')B= $_->does('Fey::Role::' . $thing . 'Like')
ABresult
0X0
100
111
121 58 };
122 }
123  
124 29 role_type SetOperationArg, { role => 'Fey::Role::SQL::ReturnsData' };
125  
126 91 ▶subtype SelectElement, as Item, where {
Subroutine __ANON__: called CC=5 SCAR=16.5
127 91 ▶ !blessed $_[0]
Branch: 1 branch
BranchTrueFalseTotal
not builtin::blessed($_[0]) or $_[0]->isa("Fey::Table") or $_[0]->isa("Fey::Table::Alias") or $_[0]->can("is_selectable") and $_[0]->is_selectable 62 29 91
Condition75%9/12
!builtin::blessed($_[0]) || $_[0]->isa('Fey::Table') || $_[0]->isa('Fey::Table::Alias') || $_[0]->can('is_selectable') && $_[0]->is_selectable
l!l&&r!l&&!r
62290
not builtin::blessed($_[0]) or $_[0]->isa("Fey::Table") or $_[0]->isa("Fey::Table::Alias")
l!l&&r!l&&!r
61129
not builtin::blessed($_[0]) or $_[0]->isa("Fey::Table")
l!l&&r!l&&!r
402130
$_[0]->can("is_selectable") and $_[0]->is_selectable
!ll&&!rl&&r
0029
MC/DC0%0/5
!builtin::blessed($_[0]) || $_[0]->isa('Fey::Table') || $_[0]->isa('Fey::Table::Alias') || $_[0]->can('is_selectable') && $_[0]->is_selectable
not builtin::blessed($_[0]) $_[0]->isa("Fey::Table") $_[0]->isa("Fey::Table::Alias") $_[0]->can("is_selectable") $_[0]->is_selectable
Truth table66%4/6
not(A) or B or C || D and E
A= not builtin::blessed($_[0])B= $_[0]->isa("Fey::Table")C= $_[0]->isa("Fey::Table::Alias")D= $_[0]->can("is_selectable")E= $_[0]->is_selectable
ABCDEresult
1XXXX1
01XXX1
001XX1
000111
0000X0
000100
128 || $_[0]->isa('Fey::Table')
129 || $_[0]->isa('Fey::Table::Alias')
130 || ( $_[0]->can('is_selectable')
131 && $_[0]->is_selectable() );
132 29 };
133  
134 25 ▶subtype ColumnWithTable, as Column, where {
Subroutine __ANON__: called CC=1 SCAR=0.0
135 25 $_[0]->has_table();
136 29 };
137  
138 43 ▶subtype IntoElement, as Object, where {
Subroutine __ANON__: called CC=4 SCAR=17.9
139 43 ▶ return $_->isa('Fey::Table')
Condition44%4/9
$_->isa('Fey::Table') || $_->isa('Fey::Column') && $_->table && !$_->table->is_alias
l!l&&r!l&&!r
1420
$_->isa("Fey::Column") and $_->table and not $_->table->is_alias
!ll&&!rl&&r
0042
$_->isa("Fey::Column") and $_->table
!ll&&!rl&&r
0042
MC/DC0%0/4
$_->isa('Fey::Table') || $_->isa('Fey::Column') && $_->table && !$_->table->is_alias
$_->isa('Fey::Table') $_->isa("Fey::Column") $_->table not $_->table->is_alias
Truth table40%2/5
A || B and C and not(D)
A= $_->isa('Fey::Table')B= $_->isa("Fey::Column")C= $_->tableD= not $_->table->is_alias
ABCDresult
1XXX1
01111
00XX0
010X0
01100
140 || ( $_->isa('Fey::Column')
141 && $_->table()
142 && !$_->table()->is_alias() );
143 29 };
144  
145 18 ▶subtype NullableInsertValue, as Item, where {
Subroutine __ANON__: called CC=6 SCAR=19.0
146 18 ▶ !blessed $_
Branch: 1 branch
BranchTrueFalseTotal
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder") or overload::Overloaded($_) 18 0 18
Condition75%9/12
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder")
l!l&&r!l&&!r
1260
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
1026
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
!ll&&!rl&&r
062
$_->does("Fey::Role::IsLiteral") or $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
206
MC/DC0%0/5
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder")
not builtin::blessed($_) $_->can("does") $_->does("Fey::Role::IsLiteral") $_->does("Fey::Role::SQL::ReturnsData") $_->isa("Fey::Placeholder")
Truth table42%3/7
not(A) or B and C or D or E
A= not builtin::blessed($_)B= $_->can("does")C= $_->does("Fey::Role::IsLiteral")D= $_->does("Fey::Role::SQL::ReturnsData")E= $_->isa("Fey::Placeholder")
ABCDEresult
1XXXX1
011XX1
0101X1
00XX11
010011
00XX00
010000
147 || (
148 $_->can('does')
149 && ( $_->does('Fey::Role::IsLiteral')
150 || $_->does('Fey::Role::SQL::ReturnsData') )
151 )
152 || $_->isa('Fey::Placeholder')
153 || overload::Overloaded($_);
154 29 };
155  
156 22 ▶subtype NonNullableInsertValue, as Defined, where {
Subroutine __ANON__: called CC=7 SCAR=19.6
157 22 ▶ !blessed $_
Branch: 1 branch
BranchTrueFalseTotal
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder") or overload::Overloaded($_) 18 4 22
Condition86%13/15
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder")
l!l&&r!l&&!r
1624
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null")
l!l&&r!l&&!r
1516
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null")
!ll&&!rl&&r
601
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
!ll&&!rl&&r
421
$_->does("Fey::Role::IsLiteral") or $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
012
MC/DC33%2/6
not builtin::blessed($_) or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder")
not builtin::blessed($_) $_->can("does") $_->does("Fey::Role::IsLiteral") $_->does("Fey::Role::SQL::ReturnsData") not $_->isa("Fey::Literal::Null") $_->isa("Fey::Placeholder")
Truth table36%4/11
not(A) or B and C or D and not(E) or F
A= not builtin::blessed($_)B= $_->can("does")C= $_->does("Fey::Role::IsLiteral")D= $_->does("Fey::Role::SQL::ReturnsData")E= not $_->isa("Fey::Literal::Null")F= $_->isa("Fey::Placeholder")
ABCDEFresult
1XXXXX1
011X1X1
01011X1
00XXX11
0100X11
011X011
0101011
00XXX00
0100X00
011X000
0101000
158 || (
159 $_->can('does')
160 && ( $_->does('Fey::Role::IsLiteral')
161 || $_->does('Fey::Role::SQL::ReturnsData') )
162 && !$_->isa('Fey::Literal::Null')
163 )
164 || $_->isa('Fey::Placeholder')
165 || overload::Overloaded($_);
166 29 };
167  
168 6 ▶subtype NullableUpdateValue, as Item, where {
Subroutine __ANON__: called CC=7 SCAR=25.7
169 6 ▶ !blessed $_
Branch: 1 branch
BranchTrueFalseTotal
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder") or overload::Overloaded($_) 6 0 6
Condition46%7/15
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder")
l!l&&r!l&&!r
600
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
510
not builtin::blessed($_) or $_->isa("Fey::Column")
l!l&&r!l&&!r
501
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
!ll&&!rl&&r
001
$_->does("Fey::Role::IsLiteral") or $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
100
MC/DC0%0/6
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") or $_->isa("Fey::Placeholder")
not builtin::blessed($_) $_->isa("Fey::Column") $_->can("does") $_->does("Fey::Role::IsLiteral") $_->does("Fey::Role::SQL::ReturnsData") $_->isa("Fey::Placeholder")
Truth table25%2/8
not(A) or B or C and D or E or F
A= not builtin::blessed($_)B= $_->isa("Fey::Column")C= $_->can("does")D= $_->does("Fey::Role::IsLiteral")E= $_->does("Fey::Role::SQL::ReturnsData")F= $_->isa("Fey::Placeholder")
ABCDEFresult
1XXXXX1
01XXXX1
0011XX1
00101X1
000XX11
0010011
000XX00
0010000
170 || $_->isa('Fey::Column')
171 || (
172 $_->can('does')
173 && ( $_->does('Fey::Role::IsLiteral')
174 || $_->does('Fey::Role::SQL::ReturnsData') )
175 )
176 || $_->isa('Fey::Placeholder')
177 || overload::Overloaded($_);
178 29 };
179  
180 19 ▶subtype NonNullableUpdateValue, as Defined, where {
Subroutine __ANON__: called CC=8 SCAR=21.3
181 19 ▶ !blessed $_
Branch: 1 branch
BranchTrueFalseTotal
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder") or overload::Overloaded($_) 15 4 19
Condition77%14/18
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder")
l!l&&r!l&&!r
1504
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null")
l!l&&r!l&&!r
964
not builtin::blessed($_) or $_->isa("Fey::Column")
l!l&&r!l&&!r
7210
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null")
!ll&&!rl&&r
406
$_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData")
!ll&&!rl&&r
406
$_->does("Fey::Role::IsLiteral") or $_->does("Fey::Role::SQL::ReturnsData")
l!l&&r!l&&!r
510
MC/DC42%3/7
not builtin::blessed($_) or $_->isa("Fey::Column") or $_->can("does") and $_->does("Fey::Role::IsLiteral") || $_->does("Fey::Role::SQL::ReturnsData") and not $_->isa("Fey::Literal::Null") or $_->isa("Fey::Placeholder")
not builtin::blessed($_) $_->isa("Fey::Column") $_->can("does") $_->does("Fey::Role::IsLiteral") $_->does("Fey::Role::SQL::ReturnsData") not $_->isa("Fey::Literal::Null") $_->isa("Fey::Placeholder")
Truth table41%5/12
not(A) or B or C and D or E and not(F) or G
A= not builtin::blessed($_)B= $_->isa("Fey::Column")C= $_->can("does")D= $_->does("Fey::Role::IsLiteral")E= $_->does("Fey::Role::SQL::ReturnsData")F= not $_->isa("Fey::Literal::Null")G= $_->isa("Fey::Placeholder")
ABCDEFGresult
1XXXXXX1
01XXXXX1
0011X1X1
001011X1
000XXX11
00100X11
0011X011
00101011
000XXX00
00100X00
0011X000
00101000
182 || $_->isa('Fey::Column')
183 || (
184 $_->can('does')
185 && ( $_->does('Fey::Role::IsLiteral')
186 || $_->does('Fey::Role::SQL::ReturnsData') )
187 && !$_->isa('Fey::Literal::Null')
188 )
189 || $_->isa('Fey::Placeholder')
190 || overload::Overloaded($_);
191 29 };
192  
193 27 ▶subtype OrderByElement, as Item, where {
Subroutine __ANON__: called CC=4 SCAR=14.9
194 27 ▶ if ( !blessed $_ ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($_)) 7 20 27
195 7 return $_ =~ /^(?:asc|desc)(?: nulls (?:last|first))?$/i;
196 }
197  
198 20 ▶ return 1
Branch: 1 branch
BranchTrueFalseTotal
if $_->can("is_orderable") and $_->is_orderable 20 0 20
Condition33%1/3
$_->can("is_orderable") and $_->is_orderable
!ll&&!rl&&r
0020
MC/DC0%0/2
$_->can("is_orderable") and $_->is_orderable
$_->can("is_orderable") $_->is_orderable
Truth table33%1/3
A and B
A= $_->can("is_orderable")B= $_->is_orderable
ABresult
0X0
100
111
199 if $_->can('is_orderable')
200 && $_->is_orderable();
201 29 };
202  
203 7 ▶subtype GroupByElement, as Object, where {
Subroutine __ANON__: called CC=3 SCAR=11.1
204 7 ▶ return 1
Branch: 1 branch
BranchTrueFalseTotal
if $_->can("is_groupable") and $_->is_groupable 6 1 7
Condition66%2/3
$_->can("is_groupable") and $_->is_groupable
!ll&&!rl&&r
016
MC/DC50%1/2
$_->can("is_groupable") and $_->is_groupable
$_->can("is_groupable") $_->is_groupable
Truth table66%2/3
A and B
A= $_->can("is_groupable")B= $_->is_groupable
ABresult
0X0
100
111
205 if $_->can('is_groupable')
206 && $_->is_groupable();
207 29 };
208  
209 1 ▶subtype OuterJoinType, as Str, where { return $_ =~ /^(?:full|left|right)$/ };
Subroutine __ANON__: called CC=1 SCAR=0.0
210  
211 subtype CanQuote, as Item,
212 86 ▶ where { return $_->isa('DBI::db') || $_->can('quote') };
Subroutine __ANON__: called CC=2 SCAR=7.1
Condition66%2/3
$_->isa('DBI::db') || $_->can('quote')
l!l&&r!l&&!r
7880
MC/DC0%0/2
$_->isa('DBI::db') || $_->can('quote')
$_->isa('DBI::db') $_->can('quote')
Truth table66%2/3
A || B
A= $_->isa('DBI::db')B= $_->can('quote')
ABresult
1X1
011
000
213  
214 12 ▶subtype WhereBoolean, as Str, where { return $_ =~ /^(?:AND|OR)$/ };
Subroutine __ANON__: called CC=1 SCAR=0.0
215  
216 191 ▶subtype WhereClauseSide, as Item, where {
Subroutine __ANON__: called CC=8 SCAR=25.7
217 191 ▶ return 1 if !defined $_;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_ 0 191 191
218 191 ▶ return 0 if ref $_ && !blessed $_;
Branch: 1 branch
BranchTrueFalseTotal
if ref $_ and not builtin::blessed($_) 0 191 191
Condition33%1/3
ref $_ and not builtin::blessed($_)
!ll&&!rl&&r
01910
MC/DC0%0/2
ref $_ and not builtin::blessed($_)
ref $_ not builtin::blessed($_)
Truth table33%1/3
A and not(B)
A= ref $_B= not builtin::blessed($_)
ABresult
0X0
100
111
219 191 ▶ return 1 unless blessed $_;
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($_) 0 191 191
220 191 ▶ return 1 if overload::Overloaded($_);
Branch: 1 branch
BranchTrueFalseTotal
if overload::Overloaded($_) 0 191 191
221  
222 191 ▶ return 1
Branch: 1 branch
BranchTrueFalseTotal
if $_->can("is_comparable") and $_->is_comparable 191 0 191
Condition33%1/3
$_->can("is_comparable") and $_->is_comparable
!ll&&!rl&&r
00191
MC/DC0%0/2
$_->can("is_comparable") and $_->is_comparable
$_->can("is_comparable") $_->is_comparable
Truth table33%1/3
A and B
A= $_->can("is_comparable")B= $_->is_comparable
ABresult
0X0
100
111
223 if $_->can('is_comparable')
224 && $_->is_comparable();
225 29 };
226  
227 29 class_type WhereClause, { class => 'Fey::SQL::Where' };
228  
229 29 class_type Table, { class => 'Fey::Table' };
230  
231 29 class_type Schema, { class => 'Fey::Schema' };
232  
233 29 class_type FK, { class => 'Fey::FK' };
234  
235 29 1;
236  
237 # ABSTRACT: Types for use in Fey
238  
239 __END__
« Fey/SQL/Fragment/Where/Comparison.pm ↑ Summary Fey/Schema.pm »