| 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'
MC/DC100%1/1
$self->SUPER::host(@_) || 'localhost'
$self->SUPER::host(@_)
Truth table100%2/2
A
A= $self->SUPER::host(@_)
| |||||||||||||||||||||||||
| 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
$self->database_from_path or $self->database_from_query
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
| |||||||||||||||||||||||||
| 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
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
| |||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||
| 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; | |||||||||||||||||||||||