blib/lib/Pinto/Schema/ResultSet/Distribution.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 87.1% 27 / 31 CC 2 SCAR 2.7
CC
2
Cov
95%
with_packages
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Pinto/Schema/ResultSet/Package.pm ↑ Summary blib/lib/Pinto/Server/Responder.pm »
1 # ABSTRACT: Common queries for Distributions
2  
3 63 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Pinto::Schema::ResultSet::Distribution;
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 66 ▶sub with_packages {
Subroutine with_packages: called CC=2 SCAR=7.2
Pod undocumented
19 66 my ( $self, $where ) = @_;
20  
21 66 ▶ return $self->search( $where || {}, { prefetch => 'packages' } );
Condition50%1/2
$where || {}
l!l
066
MC/DC0%0/1
$where || {}
$where
Truth table50%1/2
A
A= $where
Aresult
11
00
22 }
23  
24 #------------------------------------------------------------------------------
25  
26 61 ▶sub find_by_author_archive {
Subroutine find_by_author_archive: called CC=1 SCAR=0.0
Pod undocumented
27 61 my ( $self, $author, $archive ) = @_;
28  
29 61 my $where = { author => $author, archive => $archive };
30 61 my $attrs = { key => 'author_archive_unique' };
31  
32 61 return $self->find( $where, $attrs );
33 }
34  
35 #------------------------------------------------------------------------------
36 63 1;
37  
38 __END__
« blib/lib/Pinto/Schema/ResultSet/Package.pm ↑ Summary blib/lib/Pinto/Server/Responder.pm »