Smooth/Lookup/DateTime/datepart.pm

filter: Statementstmt 68.9% 20 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 1 totaltotal 65.0% 26 / 40 CC 2 SCAR 8.0
CC
2
Cov
65%
__ANON__
6.0
smooth__lookup__datepart
2.0
BEGIN
1.0
CRAP 2.2
« Smooth/ResultSet.pm ↑ Summary Smooth/Helper/Util.pm »
1 9 ▶use 5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package DBIx::Class::Smooth::Lookup::DateTime::datepart;
6  
7 # ABSTRACT: Short intro
8 9 our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY
9 9 our $VERSION = '0.0108';
10  
11 9 ▶use parent 'DBIx::Class::Smooth::Lookup::Util';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 9 ▶use Carp qw/carp confess/;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 9 ▶use experimental qw/signatures postderef/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub smooth__lookup__datepart($self, $column_name, $value, $params, @rest) {
Subroutine smooth__lookup__datepart: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $datepart = $params->[0];
17 0 $self->smooth__lookup_util__ensure_param_count($datepart, $params, { at_least => 1, at_most => 1, regex => qr/^[a-z_]+$/i });
18  
19  
20 0 ▶ local $SIG{'__WARN__'} = sub ($message) {
Subroutine __ANON__: not called CC=2 SCAR=17.9
21 0 ▶ if($message =~ m{uninitialized value within %part_map}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($message =~ /uninitialized value within %part_map/u) { } 0 0 0
22 0 confess "<datepart> was passed <$datepart> as the datepart, but your database don't support that";
23 }
24 else {
25 0 warn $message;
26 }
27 0 };
28  
29 0 my $complete = $self->dt_SQL_pluck({ -ident => $column_name }, $datepart);
30  
31 0 my $function_call_string = $complete->$*->[0];
32  
33 0 return { left_hand_function => { complete => $function_call_string }, value => $value };
34 }
35  
36 9 1;
37  
38 __END__
« Smooth/ResultSet.pm ↑ Summary Smooth/Helper/Util.pm »