Common/URI/gopher.pm

filter: Statementstmt 100% 33 / 33 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 95.7% 45 / 47 CC 3 SCAR 5.2
CC
3
Cov
97%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Common/URI/ftp.pm ↑ Summary Common/lingua.pm »
1 package Regexp::Common::URI::gopher;
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::RFC1738 qw /$host $port $uchars/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 71 ▶use Regexp::Common::URI::RFC1808 qw /$pchars $pchar_range/;
Subroutine BEGIN: called CC=1 SCAR=0.0
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 $pchars_notab = "(?:(?:[$pchar_range]+|" .
15 "%(?:[1-9a-fA-F][0-9a-fA-F]|0[0-8a-fA-F]))*)";
16  
17 71 my $gopherplus_string = $pchars;
18 71 my $search = $pchars;
19 71 my $search_notab = $pchars_notab;
20 71 my $selector = $pchars;
21 71 my $selector_notab = $pchars_notab;
22 71 my $gopher_type = "(?:[0-9+IgT])";
23  
24 71 my $scheme = "gopher";
25 71 my $uri = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?" .
26 "/(?k:(?k:$gopher_type)(?k:$selector)))";
27 71 my $uri_notab = "(?k:(?k:$scheme)://(?k:$host)(?::(?k:$port))?" .
28 "/(?k:(?k:$gopher_type)(?k:$selector_notab)" .
29 "(?:%09(?k:$search_notab)(?:%09(?k:$gopherplus_string))?)?))";
30  
31 71 register_uri $scheme => $uri;
32  
33 pattern name => [qw (URI gopher -notab=)],
34 19476 ▶ create => sub { exists $_ [1] {-notab} &&
Subroutine __ANON__: called CC=3 SCAR=11.1
35 19476 ▶ !defined $_ [1] {-notab} ? $uri_notab : $uri},
Branch: 1 branch
BranchTrueFalseTotal
exists $_[1]{'-notab'} && !defined($_[1]{'-notab'}) ? : 9738 9738 19476
Condition66%2/3
exists $_[1]{"-notab"} and not defined $_[1]{"-notab"}
!ll&&!rl&&r
097389738
MC/DC50%1/2
exists $_[1]{"-notab"} and not defined $_[1]{"-notab"}
exists $_[1]{"-notab"} not defined $_[1]{"-notab"}
Truth table66%2/3
A and not(B)
A= exists $_[1]{"-notab"}B= not defined $_[1]{"-notab"}
ABresult
0X0
100
111
36 71 ;
37  
38 71 1;
39  
40 __END__
« Common/URI/ftp.pm ↑ Summary Common/lingua.pm »