Helper/ResultSet/Shortcut/LimitedPage.pm

filter: Statementstmt 95.2% 20 / 21 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 90.6% 29 / 32 CC 4 SCAR 10.1
CC
4
Cov
93%
limited_page
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Helper/ResultSet/SetOperations.pm ↑ Summary Helper/ResultSet/ResultClassDWIM.pm »
1 package DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage;
2 55 $DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage::VERSION = '2.033001';
3 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 55 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 55 use parent qw(
7 DBIx::Class::Helper::ResultSet::Shortcut::Rows
8 DBIx::Class::Helper::ResultSet::Shortcut::Page
9 DBIx::Class::ResultSet
10 55 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub limited_page {
13 5 ▶ my $self = shift;
Subroutine limited_page: called CC=4 SCAR=13.9
Pod undocumented
14 5 ▶ if (@_ == 1) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_ == 1) { } 4 1 5
elsif (@_ == 2) { } 1 0 1
15 4 my $arg = shift;
16 4 ▶ if (ref $arg) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $arg) { } 3 1 4
17 3 my ( $page, $rows ) = @$arg{qw(page rows)};
18 3 return $self->page($page)->rows($rows);
19 } else {
20 1 return $self->page($arg);
21 }
22 } elsif (@_ == 2) {
23 1 my ( $page, $rows ) = @_;
24 1 return $self->page($page)->rows($rows);
25 } else {
26 0 die 'Invalid args passed to get_page method';
27 }
28 }
29  
30 55 1;
31  
32 __END__
33  
34 =pod
35  
36 =head1 NAME
37  
38 DBIx::Class::Helper::ResultSet::Shortcut::LimitedPage
39  
40 =head1 AUTHOR
41  
42 Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
43  
44 =head1 COPYRIGHT AND LICENSE
45  
46 This software is copyright (c) 2016 by Arthur Axel "fREW" Schmidt.
47  
48 This is free software; you can redistribute it and/or modify it under
49 the same terms as the Perl 5 programming language system itself.
50  
51 =cut
« Helper/ResultSet/SetOperations.pm ↑ Summary Helper/ResultSet/ResultClassDWIM.pm »