SQLEngine/Criteria/HashGroup.pm

filter: Statementstmt 96.1% 25 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 94.7% 36 / 38 CC 2 SCAR 2.2
CC
2
Cov
93%
normalized
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« SQLEngine/Record/Table.pm ↑ Summary SQLEngine/Cache/TrivialCache.pm »
1 package DBIx::SQLEngine::Criteria::HashGroup;
2 7 ▶use DBIx::SQLEngine::Criteria;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 7 @ISA = 'DBIx::SQLEngine::Criteria';
4 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use DBIx::SQLEngine::Criteria::And;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 7 ▶use DBIx::SQLEngine::Criteria::Or;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 7 ▶use DBIx::SQLEngine::Criteria::StringComparison;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 # 2004-02-24 Switched to StringComparison based on suggestion from Michael Kroll
10 # use DBIx::SQLEngine::Criteria::StringEquality;
11  
12 7 ▶use Class::MakeMethods (
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 'Composite::Hash:new' => [ 'new', {modifier => 'with_values'} ],
14 7 );
15  
16 45 ▶sub normalized {
Subroutine normalized: called CC=2 SCAR=7.4
Pod documented
17 45 my $hashref = shift;
18
19 DBIx::SQLEngine::Criteria::And->new(
20 map {
21 45 my ($key, $value) = ($_, $hashref->{$_});
22 ( ref( $value ) eq 'ARRAY' )
23 ? DBIx::SQLEngine::Criteria::Or->new(
24 map {
25 0 ▶ DBIx::SQLEngine::Criteria::StringComparison->new( $key, $_ )
Branch: 1 branch
BranchTrueFalseTotal
ref $value eq 'ARRAY' ? : 0 47 47
26 } @$value
27 )
28 : DBIx::SQLEngine::Criteria::StringComparison->new($key, $value)
29 } sort keys %$hashref
30 )
31 }
32  
33 45 ▶sub sql_where {
Subroutine sql_where: called CC=1 SCAR=0.0
Pod documented
34 45 (shift)->normalized->sql_where( @_ )
35 }
36  
37 7 1;
38  
39 __END__
« SQLEngine/Record/Table.pm ↑ Summary SQLEngine/Cache/TrivialCache.pm »