Overlay/Types.pm

filter: Statementstmt 94.2% 33 / 35 Branchbran 50.0% 4 / 8 Conditioncond 33.3% 4 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 90.9% 10 / 11 Podpod n/a totaltotal 70.8% 51 / 72 CC 9 SCAR 13.1
CC
9
Cov
75%
__ANON__
6.7
__ANON__
6.7
__ANON__
2.1
CRAP 3.7
↑ Summary Overlay/Exceptions.pm »
1 8 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Gentoo::Overlay::Types;
6  
7 8 our $VERSION = '2.001002';
8  
9 # ABSTRACT: Gentoo Overlay types.
10  
11 8 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
12  
13 8 ▶use Type::Library 0.008 '-base', -declare => qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
14 Gentoo__Overlay_Overlay
15 Gentoo__Overlay_Category
16 Gentoo__Overlay_Ebuild
17 Gentoo__Overlay_Package
18 Gentoo__Overlay_CategoryName
19 Gentoo__Overlay_EbuildName
20 Gentoo__Overlay_PackageName
21 Gentoo__Overlay_RepositoryName
22 8 );
23 8 ▶use Type::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 8 ▶use Types::Standard qw( Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26  
27  
28  
29  
30  
31  
32  
33  
34 8 class_type Gentoo__Overlay_Overlay, { class => 'Gentoo::Overlay' };
35 0 ▶coerce Gentoo__Overlay_Overlay, from Str, via {
Subroutine __ANON__: not called CC=1 SCAR=6.9
36 0 require Gentoo::Overlay;
37 0 return Gentoo::Overlay->new( path => $_ );
38 8 };
39  
40  
41  
42  
43  
44  
45  
46 8 class_type Gentoo__Overlay_Category, { class => 'Gentoo::Overlay::Category' };
47  
48  
49  
50  
51  
52  
53  
54 8 class_type Gentoo__Overlay_Ebuild, { class => 'Gentoo::Overlay::Ebuild' };
55  
56  
57  
58  
59  
60  
61  
62 8 class_type Gentoo__Overlay_Package, { class => 'Gentoo::Overlay::Package' };
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73 12 ▶declare Gentoo__Overlay_CategoryName, as Str, where {
Subroutine __ANON__: called CC=2 SCAR=7.6
74 ## no critic ( RegularExpressions )
75 12 ▶ $_ =~ qr/^[a-zA-Z0-9+_.-]+$/
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ qr/^[a-zA-Z0-9+_.-]+$/ and not $_ =~ qr/^[-.]/ 12 0 12
76 && $_ !~ qr/^[-.]/;
77 8 };
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90 1 ▶declare Gentoo__Overlay_EbuildName, as Str, where {
Subroutine __ANON__: called CC=4 SCAR=19.1
91 ## no critic ( RegularExpressions )
92 1 ▶ $_ =~ qr/^[A-Za-z0-9+_.-]+$/
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/ and $_ =~ qr/\.ebuild$/ 1 0 1
Condition33%2/6
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
!ll&&!rl&&r
001
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/
!ll&&!rl&&r
001
MC/DC0%0/3
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_.-]+$/ not $_ =~ qr/^-/ not $_ =~ qr/-$/
Truth table25%1/4
A and not(B) and not(C)
A= $_ =~ qr/^[A-Za-z0-9+_.-]+$/B= not $_ =~ qr/^-/C= not $_ =~ qr/-$/
ABCresult
0XX0
10X0
1100
1111
93 && $_ !~ qr/^-/
94 && $_ !~ qr/-$/
95 && $_ =~ qr/\.ebuild$/;
96 8 };
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109 5 ▶declare Gentoo__Overlay_PackageName, as Str, where {
Subroutine __ANON__: called CC=4 SCAR=19.1
110 ## no critic ( RegularExpressions )
111 5 ▶ $_ =~ qr/^[A-Za-z0-9+_-]+$/
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/ and not $_ =~ qr/-\d+$/ 5 0 5
Condition33%2/6
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
!ll&&!rl&&r
005
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/
!ll&&!rl&&r
005
MC/DC0%0/3
$_ =~ qr/^[A-Za-z0-9+_-]+$/ and not $_ =~ qr/^-/ and not $_ =~ qr/-$/
$_ =~ qr/^[A-Za-z0-9+_-]+$/ not $_ =~ qr/^-/ not $_ =~ qr/-$/
Truth table25%1/4
A and not(B) and not(C)
A= $_ =~ qr/^[A-Za-z0-9+_-]+$/B= not $_ =~ qr/^-/C= not $_ =~ qr/-$/
ABCresult
0XX0
10X0
1100
1111
112 && $_ !~ qr/^-/
113 && $_ !~ qr/-$/
114 && $_ !~ qr/-\d+$/;
115 8 };
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126 5 ▶declare Gentoo__Overlay_RepositoryName, as Str, where {
Subroutine __ANON__: called CC=2 SCAR=7.6
127 ## no critic ( RegularExpressions )
128  
129 5 ▶ $_ =~ qr/^[A-Za-z0-9_-]+$/
Branch: 1 branch
BranchTrueFalseTotal
$_ =~ qr/^[A-Za-z0-9_-]+$/ and not $_ =~ qr/^-/ 5 0 5
130 && $_ !~ qr/^-/;
131 8 };
132  
133 8 1;
134  
135 __END__
↑ Summary Overlay/Exceptions.pm »