| 1 | package Regexp::Common::URI::ftp; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 71 | ▶ | use Regexp::Common qw /pattern clean no_defaults/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 71 | ▶ | use Regexp::Common::URI qw /register_uri/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 71 | ▶ | use Regexp::Common::URI::RFC2396 qw /$host $port $ftp_segments $userinfo | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 71 | $userinfo_no_colon/; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 71 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 71 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 71 | our $VERSION = '2024080801'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 71 | my $ftp_uri = "(?k:(?k:ftp)://(?:(?k:$userinfo)(?k:)\@)?(?k:$host)" . | |||||||||||||||||||||||||||
| 15 | "(?::(?k:$port))?(?k:/(?k:(?k:$ftp_segments)" . | ||||||||||||||||||||||||||||
| 16 | "(?:;type=(?k:[AIai]))?))?)"; | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 71 | my $ftp_uri_password = | |||||||||||||||||||||||||||
| 19 | "(?k:(?k:ftp)://(?:(?k:$userinfo_no_colon)" . | ||||||||||||||||||||||||||||
| 20 | "(?::(?k:$userinfo_no_colon))?\@)?(?k:$host)" . | ||||||||||||||||||||||||||||
| 21 | "(?::(?k:$port))?(?k:/(?k:(?k:$ftp_segments)" . | ||||||||||||||||||||||||||||
| 22 | "(?:;type=(?k:[AIai]))?))?)"; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 71 | register_uri FTP => $ftp_uri; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | pattern name => [qw (URI FTP), "-type=[AIai]", "-password="], | ||||||||||||||||||||||||||||
| 27 | 3 | ▶ | create => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 28 | my $uri = exists $_ [1] -> {-password} && | ||||||||||||||||||||||||||||
| 29 | 3 | ▶ | !defined $_ [1] -> {-password} ? $ftp_uri_password | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $_[1]{"-password"} and not defined $_[1]{"-password"}
MC/DC50%1/2
exists $_[1]{"-password"} and not defined $_[1]{"-password"}
exists $_[1]{"-password"}
not defined $_[1]{"-password"}
Truth table66%2/3
A and not(B)
A= exists $_[1]{"-password"}B= not defined $_[1]{"-password"}
| |||||||||||||||||||||||||||||
| 30 | : $ftp_uri; | ||||||||||||||||||||||||||||
| 31 | 3 | my $type = $_ [1] -> {-type}; | |||||||||||||||||||||||||||
| 32 | 3 | $uri =~ s/\[AIai\]/$type/; | |||||||||||||||||||||||||||
| 33 | 3 | $uri; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 71 | ; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 71 | 1; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | __END__ | ||||||||||||||||||||||||||||