_redis.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 2 / 2 Conditioncond 100% 10 / 10 MC/DCmcdc 100% 5 / 5 Subroutinesub 100% 12 / 12 Podpod 22.2% 2 / 9 totaltotal 89.8% 62 / 69 CC 6 SCAR 5.3
CC
6
Cov
100%
database
3.0
host
2.0
password
2.0
CRAP 1.7
↑ Summary redis_Punix.pm »
1 package URI::_redis;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.01';
7
8 2 ▶use base qw( URI::_login );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub host {
11 5 ▶ my $self = shift;
Subroutine host: called CC=2 SCAR=6.9
Pod documented
12  
13 5 ▶ return $self->SUPER::host(@_) || 'localhost';
Condition100%2/2
$self->SUPER::host(@_) || 'localhost'
l!l
41
MC/DC100%1/1
$self->SUPER::host(@_) || 'localhost'
$self->SUPER::host(@_)
Truth table100%2/2
A
A= $self->SUPER::host(@_)
Aresult
11
00
14 }
15  
16 1 ▶sub default_port { 6379 }
Subroutine default_port: called CC=1 SCAR=0.0
Pod documented
17  
18 sub database {
19 8 ▶ my $self = shift;
Subroutine database: called CC=3 SCAR=11.0
Pod undocumented
20  
21 8 ▶ return $self->database_from_path || $self->database_from_query || 0;
Condition100%5/5
$self->database_from_path || $self->database_from_query || 0
l!l
62
$self->database_from_path or $self->database_from_query
l!l&&r!l&&!r
242
MC/DC100%2/2
$self->database_from_path || $self->database_from_query || 0
$self->database_from_path $self->database_from_query
Truth table100%3/3
A or B
A= $self->database_from_pathB= $self->database_from_query
ABresult
1X1
011
000
22 }
23  
24 sub database_from_path {
25 10 ▶ my $self = shift;
Subroutine database_from_path: called CC=1 SCAR=0.0
Pod undocumented
26  
27 10 my ($database) = $self->path =~ m{ ^ / (\d+) $ }x;
28  
29 10 return $database;
30 }
31
32 sub database_from_query {
33 14 ▶ my $self = shift;
Subroutine database_from_query: called CC=1 SCAR=0.0
Pod undocumented
34  
35 14 return { $self->query_form }->{db};
36 }
37
38 sub password {
39 8 ▶ my $self = shift;
Subroutine password: called CC=2 SCAR=6.9
Pod undocumented
40  
41 8 ▶ return $self->password_from_userinfo || $self->password_from_query;
Condition100%3/3
$self->password_from_userinfo || $self->password_from_query
l!l&&r!l&&!r
332
MC/DC100%2/2
$self->password_from_userinfo || $self->password_from_query
$self->password_from_userinfo $self->password_from_query
Truth table100%3/3
A || B
A= $self->password_from_userinfoB= $self->password_from_query
ABresult
1X1
011
000
42 }
43
44 sub password_from_userinfo {
45 16 ▶ my $self = shift;
Subroutine password_from_userinfo: called CC=2 SCAR=6.9
Pod undocumented
46  
47 16 ▶ my $userinfo = $self->userinfo
Branch: 1 branch
BranchTrueFalseTotal
my $userinfo = $self->userinfo or return 10 6 16
48 or return;
49  
50 6 my ($password) = $userinfo =~ m{ ^ .* : ([^@]+) }x;
51  
52 6 return $password;
53 }
54
55 sub password_from_query {
56 13 ▶ my $self = shift;
Subroutine password_from_query: called CC=1 SCAR=0.0
Pod undocumented
57  
58 13 return { $self->query_form }->{password};
59 }
60  
61 sub socket_path {
62 3 ▶ my $self = shift;
Subroutine socket_path: called CC=1 SCAR=0.0
Pod undocumented
63  
64 3 return $self->path;
65 }
66  
67 2 1;
↑ Summary redis_Punix.pm »