Junction/Any.pm

filter: Statementstmt 100% 78 / 78 Branchbran 100% 50 / 50 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 17 / 17 Podpod 0.0% 0 / 15 totaltotal 90.6% 145 / 160 CC 41 SCAR 12.9
CC
41
Cov
100%
num_eq
4.0
num_ne
4.0
num_ge
4.0
CRAP 3.6
« Junction/All.pm ↑ Summary Junction/None.pm »
1 package Perl6::Junction::Any;
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 15 ▶sub num_eq {
Subroutine num_eq: called CC=4 SCAR=13.9
Pod undocumented
8 15 ▶ return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 5 10 15
9  
10 10 my ( $self, $test ) = @_;
11  
12 10 for (@$self) {
13 14 ▶ return 1 if $_ == $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ == $test 7 7 14
14 }
15  
16 3 return;
17 }
18  
19 6 ▶sub num_ne {
Subroutine num_ne: called CC=4 SCAR=13.9
Pod undocumented
20 6 ▶ return regex_ne(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 3 3 6
21  
22 3 my ( $self, $test ) = @_;
23  
24 3 for (@$self) {
25 5 ▶ return 1 if $_ != $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ != $test 2 3 5
26 }
27  
28 1 return;
29 }
30  
31 10 ▶sub num_ge {
Subroutine num_ge: called CC=4 SCAR=13.9
Pod undocumented
32 10 my ( $self, $test, $switch ) = @_;
33  
34 10 ▶ return num_le( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 7 10
35  
36 7 for (@$self) {
37 17 ▶ return 1 if $_ >= $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ >= $test 5 12 17
38 }
39  
40 2 return;
41 }
42  
43 12 ▶sub num_gt {
Subroutine num_gt: called CC=4 SCAR=13.9
Pod undocumented
44 12 my ( $self, $test, $switch ) = @_;
45  
46 12 ▶ return num_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 6 6 12
47  
48 6 for (@$self) {
49 13 ▶ return 1 if $_ > $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ > $test 4 9 13
50 }
51  
52 2 return;
53 }
54  
55 9 ▶sub num_le {
Subroutine num_le: called CC=4 SCAR=13.9
Pod undocumented
56 9 my ( $self, $test, $switch ) = @_;
57  
58 9 ▶ return num_ge( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 6 9
59  
60 6 for (@$self) {
61 10 ▶ return 1 if $_ <= $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ <= $test 4 6 10
62 }
63  
64 2 return;
65 }
66  
67 12 ▶sub num_lt {
Subroutine num_lt: called CC=4 SCAR=13.9
Pod undocumented
68 12 my ( $self, $test, $switch ) = @_;
69  
70 12 ▶ return num_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 9 12
71  
72 9 for (@$self) {
73 15 ▶ return 1 if $_ < $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ < $test 7 8 15
74 }
75  
76 2 return;
77 }
78  
79 3 ▶sub str_eq {
Subroutine str_eq: called CC=3 SCAR=11.0
Pod undocumented
80 3 my ( $self, $test ) = @_;
81  
82 3 for (@$self) {
83 4 ▶ return 1 if $_ eq $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq $test 2 2 4
84 }
85  
86 1 return;
87 }
88  
89 2 ▶sub str_ne {
Subroutine str_ne: called CC=3 SCAR=11.0
Pod undocumented
90 2 my ( $self, $test ) = @_;
91  
92 2 for (@$self) {
93 4 ▶ return 1 if $_ ne $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ ne $test 1 3 4
94 }
95  
96 1 return;
97 }
98  
99 9 ▶sub str_ge {
Subroutine str_ge: called CC=4 SCAR=13.9
Pod undocumented
100 9 my ( $self, $test, $switch ) = @_;
101  
102 9 ▶ return str_le( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 6 9
103  
104 6 for (@$self) {
105 8 ▶ return 1 if $_ ge $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ ge $test 4 4 8
106 }
107  
108 2 return;
109 }
110  
111 10 ▶sub str_gt {
Subroutine str_gt: called CC=4 SCAR=13.9
Pod undocumented
112 10 my ( $self, $test, $switch ) = @_;
113  
114 10 ▶ return str_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 4 6 10
115  
116 6 for (@$self) {
117 9 ▶ return 1 if $_ gt $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ gt $test 4 5 9
118 }
119  
120 2 return;
121 }
122  
123 9 ▶sub str_le {
Subroutine str_le: called CC=4 SCAR=13.9
Pod undocumented
124 9 my ( $self, $test, $switch ) = @_;
125  
126 9 ▶ return str_ge( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 6 9
127  
128 6 for (@$self) {
129 8 ▶ return 1 if $_ le $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ le $test 4 4 8
130 }
131  
132 2 return;
133 }
134  
135 10 ▶sub str_lt {
Subroutine str_lt: called CC=4 SCAR=13.9
Pod undocumented
136 10 my ( $self, $test, $switch ) = @_;
137  
138 10 ▶ return str_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 7 10
139  
140 7 for (@$self) {
141 12 ▶ return 1 if $_ lt $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ lt $test 4 8 12
142 }
143  
144 3 return;
145 }
146  
147 5 ▶sub regex_eq {
Subroutine regex_eq: called CC=3 SCAR=11.0
Pod undocumented
148 5 my ( $self, $test, $switch ) = @_;
149  
150 5 for (@$self) {
151 11 ▶ return 1 if $_ =~ $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ =~ /$test/ 2 9 11
152 }
153  
154 3 return;
155 }
156  
157 3 ▶sub regex_ne {
Subroutine regex_ne: called CC=3 SCAR=11.0
Pod undocumented
158 3 my ( $self, $test, $switch ) = @_;
159  
160 3 for (@$self) {
161 9 ▶ return 1 if $_ !~ $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ =~ /$test/ 2 7 9
162 }
163  
164 1 return;
165 }
166  
167 3 ▶sub bool {
Subroutine bool: called CC=3 SCAR=11.0
Pod undocumented
168 3 my ($self) = @_;
169  
170 3 for (@$self) {
171 5 ▶ return 1 if $_;
Branch: 1 branch
BranchTrueFalseTotal
if $_ 2 3 5
172 }
173  
174 1 return;
175 }
176  
177 8 1;
178  
« Junction/All.pm ↑ Summary Junction/None.pm »