| 1 | package DBIx::SQLEngine::Criteria; | ||||||||||||||||||||||||||
| 2 | 12 | ▶ | use strict; | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||
| 4 | ######################################################################## | ||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||
| 6 | 12 | ▶ | use Class::MakeMethods ( | ||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||
| 7 | 12 | 'Standard::Universal:abstract' => 'new', | |||||||||||||||||||||||||
| 8 | 'Template::ClassName:subclass_name --require' => 'type', | ||||||||||||||||||||||||||
| 9 | 12 | ); | |||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||
| 11 | 100 | ▶ | sub type_new { | ||||||||||||||||||||||||
|
Subroutine
type_new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||
| 12 | 100 | (shift)->type( shift )->new( @_ ); | |||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||
| 15 | ######################################################################## | ||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||
| 17 | 50 | ▶ | sub auto { | ||||||||||||||||||||||||
|
Subroutine
auto: called CC=7 SCAR=21.5
Pod
documented
| |||||||||||||||||||||||||||
| 18 | 50 | my $package = shift; | |||||||||||||||||||||||||
| 19 | 50 | local $_ = shift; | |||||||||||||||||||||||||
| 20 | 50 | ▶ | if ( ! $_ ) { | ||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||
| 21 | 0 | (); | |||||||||||||||||||||||||
| 22 | ▶ | } elsif ( ! ref( $_ ) and length( $_ ) ) { | |||||||||||||||||||||||||
|
Condition66%2/3
not ref $_ and length $_
MC/DC50%1/2
not ref $_ and length $_
not ref $_
length $_
Truth table66%2/3
not(A) and B
A= not ref $_B= length $_
| |||||||||||||||||||||||||||
| 23 | 4 | $package->type_new('LiteralSQL', $_ ); | |||||||||||||||||||||||||
| 24 | } elsif ( UNIVERSAL::can($_, 'sql_where') ) { | ||||||||||||||||||||||||||
| 25 | 0 | $_; | |||||||||||||||||||||||||
| 26 | } elsif ( ref($_) eq 'ARRAY' ) { | ||||||||||||||||||||||||||
| 27 | 1 | $package->type_new('LiteralSQL', @$_ ); | |||||||||||||||||||||||||
| 28 | } elsif ( ref($_) eq 'HASH' ) { | ||||||||||||||||||||||||||
| 29 | 45 | $package->type_new('HashGroup', %$_ ); | |||||||||||||||||||||||||
| 30 | } else { | ||||||||||||||||||||||||||
| 31 | 0 | confess("Unsupported criteria spec '$_'"); | |||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||
| 35 | 50 | ▶ | sub auto_and { | ||||||||||||||||||||||||
|
Subroutine
auto_and: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||
| 36 | 50 | my $package = shift; | |||||||||||||||||||||||||
| 37 | 50 | $package->type_new('And', map { $package->auto( $_ ) } @_ ) | |||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||
| 40 | 50 | ▶ | sub auto_where { | ||||||||||||||||||||||||
|
Subroutine
auto_where: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||
| 41 | 50 | my $package = shift; | |||||||||||||||||||||||||
| 42 | 50 | $package->auto_and( @_ )->sql_where; | |||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||
| 45 | ######################################################################## | ||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||
| 47 | package DBIx::SQLEngine::Criteria::StringEquality; | ||||||||||||||||||||||||||
| 48 | 12 | require DBIx::SQLEngine::Criteria::Equality; | |||||||||||||||||||||||||
| 49 | 12 | @DBIx::SQLEngine::Criteria::StringEquality::ISA = | |||||||||||||||||||||||||
| 50 | 'DBIx::SQLEngine::Criteria::Equality'; | ||||||||||||||||||||||||||
| 51 | 0 | ▶ | sub sql_comparator { DBIx::SQLEngine::Criteria::Equality->sql_comparator } | ||||||||||||||||||||||||
|
Subroutine
sql_comparator: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||
| 53 | ######################################################################## | ||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||
| 55 | package DBIx::SQLEngine::Criteria::NumericLesser; | ||||||||||||||||||||||||||
| 56 | 12 | require DBIx::SQLEngine::Criteria::Lesser; | |||||||||||||||||||||||||
| 57 | 12 | @DBIx::SQLEngine::Criteria::NumericLesser::ISA = | |||||||||||||||||||||||||
| 58 | 'DBIx::SQLEngine::Criteria::Lesser'; | ||||||||||||||||||||||||||
| 59 | 0 | ▶ | sub sql_comparator { DBIx::SQLEngine::Criteria::Lesser->sql_comparator } | ||||||||||||||||||||||||
|
Subroutine
sql_comparator: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||
| 61 | ######################################################################## | ||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||
| 63 | 12 | 1; | |||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||
| 65 | __END__ | ||||||||||||||||||||||||||