Junction/One.pm

filter: Statementstmt 100% 123 / 123 Branchbran 99.0% 109 / 110 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 17 / 17 Podpod 0.0% 0 / 15 totaltotal 93.9% 249 / 265 CC 71 SCAR 17.2
CC
71
Cov
100%
num_eq
6.0
num_ne
6.0
num_ge
6.0
CRAP 5.6
↑ Summary Junction/All.pm »
1 package Perl6::Junction::One;
2 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 our $VERSION = '1.60000';
4  
5 8 ▶use base 'Perl6::Junction::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 17 ▶sub num_eq {
Subroutine num_eq: called CC=6 SCAR=17.9
Pod undocumented
8 17 ▶ return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 5 12 17
9  
10 12 my ( $self, $test ) = @_;
11 12 my $count = 0;
12  
13 12 for (@$self) {
14 27 ▶ if ( $_ == $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ == $test) 12 15 27
15 12 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 10 12
16 10 $count = 1;
17 }
18 }
19  
20 10 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 8 2 10
21 }
22  
23 7 ▶sub num_ne {
Subroutine num_ne: called CC=6 SCAR=17.9
Pod undocumented
24 7 ▶ return regex_ne(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 4 3 7
25  
26 3 my ( $self, $test ) = @_;
27 3 my $count = 0;
28  
29 3 for (@$self) {
30 6 ▶ if ( $_ != $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ != $test) 3 3 6
31 3 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 2 3
32 2 $count = 1;
33 }
34 }
35  
36 2 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 1 2
37 }
38  
39 17 ▶sub num_ge {
Subroutine num_ge: called CC=6 SCAR=17.9
Pod undocumented
40 17 my ( $self, $test, $switch ) = @_;
41  
42 17 ▶ return num_le( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 7 10 17
43  
44 10 my $count = 0;
45  
46 10 for (@$self) {
47 29 ▶ if ( $_ >= $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ >= $test) 11 18 29
48 11 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 3 8 11
49 8 $count = 1;
50 }
51 }
52  
53 7 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 5 2 7
54 }
55  
56 12 ▶sub num_gt {
Subroutine num_gt: called CC=6 SCAR=17.9
Pod undocumented
57 12 my ( $self, $test, $switch ) = @_;
58  
59 12 ▶ return num_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 8 12
60  
61 8 my $count = 0;
62  
63 8 for (@$self) {
64 23 ▶ if ( $_ > $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ > $test) 8 15 23
65 8 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 6 8
66 6 $count = 1;
67 }
68 }
69  
70 6 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 4 2 6
71 }
72  
73 14 ▶sub num_le {
Subroutine num_le: called CC=6 SCAR=17.9
Pod undocumented
74 14 my ( $self, $test, $switch ) = @_;
75  
76 14 ▶ return num_ge( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 11 14
77  
78 11 my $count = 0;
79  
80 11 for (@$self) {
81 23 ▶ if ( $_ <= $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ <= $test) 11 12 23
82 11 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 9 11
83 9 $count = 1;
84 }
85 }
86  
87 9 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 7 2 9
88 }
89  
90 12 ▶sub num_lt {
Subroutine num_lt: called CC=6 SCAR=17.9
Pod undocumented
91 12 my ( $self, $test, $switch ) = @_;
92  
93 12 ▶ return num_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 8 12
94  
95 8 my $count = 0;
96  
97 8 for (@$self) {
98 21 ▶ if ( $_ < $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ < $test) 8 13 21
99 8 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 6 8
100 6 $count = 1;
101 }
102 }
103  
104 6 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 4 2 6
105 }
106  
107 3 ▶sub str_eq {
Subroutine str_eq: called CC=5 SCAR=16.1
Pod undocumented
108 3 my ( $self, $test ) = @_;
109 3 my $count = 0;
110  
111 3 for (@$self) {
112 6 ▶ if ( $_ eq $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ eq $test) 3 3 6
113 3 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 2 3
114 2 $count = 1;
115 }
116 }
117  
118 2 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 1 2
119 }
120  
121 4 ▶sub str_ne {
Subroutine str_ne: called CC=5 SCAR=16.1
Pod undocumented
122 4 my ( $self, $test ) = @_;
123 4 my $count = 0;
124  
125 4 for (@$self) {
126 9 ▶ if ( $_ ne $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ ne $test) 4 5 9
127 4 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 3 4
128 3 $count = 1;
129 }
130 }
131  
132 3 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 1 3
133 }
134  
135 11 ▶sub str_ge {
Subroutine str_ge: called CC=6 SCAR=17.9
Pod undocumented
136 11 my ( $self, $test, $switch ) = @_;
137  
138 11 ▶ return str_le( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 7 11
139  
140 7 my $count = 0;
141  
142 7 for (@$self) {
143 13 ▶ if ( $_ ge $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ ge $test) 7 6 13
144 7 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 5 7
145 5 $count = 1;
146 }
147 }
148  
149 5 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 3 2 5
150 }
151  
152 11 ▶sub str_gt {
Subroutine str_gt: called CC=6 SCAR=17.9
Pod undocumented
153 11 my ( $self, $test, $switch ) = @_;
154  
155 11 ▶ return str_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 7 11
156  
157 7 my $count = 0;
158  
159 7 for (@$self) {
160 14 ▶ if ( $_ gt $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ gt $test) 8 6 14
161 8 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 6 8
162 6 $count = 1;
163 }
164 }
165  
166 5 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 4 1 5
167 }
168  
169 10 ▶sub str_le {
Subroutine str_le: called CC=6 SCAR=17.9
Pod undocumented
170 10 my ( $self, $test, $switch ) = @_;
171  
172 10 ▶ return str_ge( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 7 10
173  
174 7 my $count = 0;
175  
176 7 for (@$self) {
177 14 ▶ if ( $_ le $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ le $test) 5 9 14
178 5 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 4 5
179 4 $count = 1;
180 }
181 }
182  
183 6 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 3 3 6
184 }
185  
186 12 ▶sub str_lt {
Subroutine str_lt: called CC=6 SCAR=17.9
Pod undocumented
187 12 my ( $self, $test, $switch ) = @_;
188  
189 12 ▶ return str_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 8 12
190  
191 8 my $count = 0;
192  
193 8 for (@$self) {
194 16 ▶ if ( $_ lt $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ lt $test) 8 8 16
195 8 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 6 8
196 6 $count = 1;
197 }
198 }
199  
200 6 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 4 2 6
201 }
202  
203 5 ▶sub regex_eq {
Subroutine regex_eq: called CC=5 SCAR=16.1
Pod undocumented
204 5 my ( $self, $test, $switch ) = @_;
205  
206 5 my $count = 0;
207  
208 5 for (@$self) {
209 12 ▶ if ( $_ =~ $test ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /$test/) 8 4 12
210 8 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 3 5 8
211 5 $count = 1;
212 }
213 }
214  
215 2 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 0 2
216 }
217  
218 4 ▶sub regex_ne {
Subroutine regex_ne: called CC=5 SCAR=16.1
Pod undocumented
219 4 my ( $self, $test, $switch ) = @_;
220  
221 4 my $count = 0;
222  
223 4 for (@$self) {
224 11 ▶ if ( $_ !~ $test ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($_ =~ /$test/) 4 7 11
225 4 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 3 4
226 3 $count = 1;
227 }
228 }
229  
230 3 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 2 1 3
231 }
232  
233 5 ▶sub bool {
Subroutine bool: called CC=5 SCAR=16.1
Pod undocumented
234 5 my ($self) = @_;
235 5 my $count = 0;
236  
237 5 for (@$self) {
238 11 ▶ if ($_) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_) 5 6 11
239 5 ▶ return if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 1 4 5
240 4 $count = 1;
241 }
242 }
243  
244 4 ▶ return 1 if $count;
Branch: 1 branch
BranchTrueFalseTotal
if $count 3 1 4
245 }
246  
247 8 1;
248  
↑ Summary Junction/All.pm »