| 1 | # ABSTRACT: Common queries for Registrations | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 63 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Pinto::Schema::ResultSet::Registration; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 63 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 63 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 63 | ▶ | use base 'DBIx::Class::ResultSet'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 63 | our $VERSION = '0.14'; # VERSION | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 12 | ▶ | sub with_package { | ||||||||||||||||||
|
Subroutine
with_package: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 19 | 12 | my ( $self, $where ) = @_; | |||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 12 | ▶ | return $self->search( $where || {}, { prefetch => 'package' } ); | ||||||||||||||||||
|
Condition50%1/2
$where || {}
MC/DC0%0/1
$where || {}
$where
Truth table50%1/2
A
A= $where
| |||||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 12 | ▶ | sub with_distribution { | ||||||||||||||||||
|
Subroutine
with_distribution: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||
| 27 | 12 | my ( $self, $where ) = @_; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 12 | ▶ | return $self->search( $where || {}, { prefetch => 'distribution' } ); | ||||||||||||||||||
|
Condition50%1/2
$where || {}
MC/DC0%0/1
$where || {}
$where
Truth table50%1/2
A
A= $where
| |||||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | sub with_revision { | ||||||||||||||||||
|
Subroutine
with_revision: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 35 | 0 | my ( $self, $where ) = @_; | |||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | ▶ | return $self->search( $where || {}, { revision => 'distribution' } ); | ||||||||||||||||||
|
Condition0%0/2
$where || {}
MC/DC0%0/1
$where || {}
$where
Truth table0%0/2
A
A= $where
| |||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 12 | ▶ | sub as_hash { | ||||||||||||||||||
|
Subroutine
as_hash: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||||||||||||
| 43 | 12 | my ( $self, $cb ) = @_; | |||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | ▶ | $cb ||= sub { return ( $_[0]->id => $_[0] ) }; | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=2.0
Condition33%1/3
$cb ||= sub {
return $_[0]->id, $_[0];
}
MC/DC0%0/2
$cb ||= sub {
return $_[0]->id, $_[0];
}
$cb
sub {
return $_[0]->id, $_[0];
}
Truth table33%1/3
A ||= B
A= $cbB= sub {
return $_[0]->id, $_[0];
}
| |||||||||||||||||||||
| 46 | 12 | my %hash = map { $cb->($_) } $self->all; | |||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 12 | ▶ | return wantarray ? %hash : \%hash; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | #------------------------------------------------------------------------------ | ||||||||||||||||||||
| 52 | 63 | 1; | |||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | __END__ | ||||||||||||||||||||