Session/Role/Redis.pm

filter: Statementstmt 70.0% 14 / 20 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 64.2% 18 / 28 CC 2 SCAR 9.8
CC
2
Cov
64%
_build__jedi_session
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Session/Backend/Redis.pm ↑ Summary Session/Backend/SQLite.pm »
1 #
2 # This file is part of Jedi-Plugin-Session
3 #
4 # This software is copyright (c) 2013 by celogeek <me@celogeek.com>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 package Jedi::Plugin::Session::Role::Redis;
10  
11 # ABSTRACT: Redis Backend
12  
13 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 our $VERSION = '0.05'; # VERSION
16  
17 1 ▶use Jedi::Plugin::Session::Backend::Redis;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub _build__jedi_session {
Subroutine _build__jedi_session: not called CC=2 SCAR=17.9
21 0 my ($self) = @_;
22 0 my $class = ref $self;
23 my $expires_in = $self->jedi_config->{$class}{session}{expiration}
24 0 ▶ // '3 hours';
Condition0%0/2
$self->jedi_config->{$class}{"session"}{"expiration"} // "3 hours"
l!l
00
MC/DC0%0/1
$self->jedi_config->{$class}{"session"}{"expiration"} // "3 hours"
$self->jedi_config->{$class}{"session"}{"expiration"}
Truth table0%0/2
A
A= $self->jedi_config->{$class}{"session"}{"expiration"}
Aresult
11
00
25 0 my $redis_config = $self->jedi_config->{$class}{session}{redis}{config};
26 0 my $redis_prefix = $self->jedi_config->{$class}{session}{redis}{prefix};
27 0 return Jedi::Plugin::Session::Backend::Redis->new(
28 config => $redis_config,
29 expires_in => $expires_in,
30 prefix => $redis_prefix
31 );
32 }
33  
34 1 1;
35  
36 __END__
« Session/Backend/Redis.pm ↑ Summary Session/Backend/SQLite.pm »