Junction/All.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/One.pm ↑ Summary Junction/Any.pm »
1 package Perl6::Junction::All;
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 35 ▶sub num_eq {
Subroutine num_eq: called CC=4 SCAR=13.9
Pod undocumented
8 35 ▶ return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 5 30 35
9  
10 30 my ( $self, $test ) = @_;
11  
12 30 for (@$self) {
13 50 ▶ return unless $_ == $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ == $test 16 34 50
14 }
15  
16 14 return 1;
17 }
18  
19 9 ▶sub num_ne {
Subroutine num_ne: called CC=4 SCAR=13.9
Pod undocumented
20 9 ▶ return regex_ne(@_) if ref( $_[1] ) eq 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[1] eq "Regexp" 4 5 9
21  
22 5 my ( $self, $test ) = @_;
23  
24 5 for (@$self) {
25 11 ▶ return unless $_ != $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ != $test 2 9 11
26 }
27  
28 3 return 1;
29 }
30  
31 28 ▶sub num_ge {
Subroutine num_ge: called CC=4 SCAR=13.9
Pod undocumented
32 28 my ( $self, $test, $switch ) = @_;
33  
34 28 ▶ return num_le( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 17 11 28
35  
36 11 for (@$self) {
37 23 ▶ return unless $_ >= $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ >= $test 4 19 23
38 }
39  
40 7 return 1;
41 }
42  
43 13 ▶sub num_gt {
Subroutine num_gt: called CC=4 SCAR=13.9
Pod undocumented
44 13 my ( $self, $test, $switch ) = @_;
45  
46 13 ▶ return num_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 5 8 13
47  
48 8 for (@$self) {
49 14 ▶ return unless $_ > $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ > $test 5 9 14
50 }
51  
52 3 return 1;
53 }
54  
55 23 ▶sub num_le {
Subroutine num_le: called CC=4 SCAR=13.9
Pod undocumented
56 23 my ( $self, $test, $switch ) = @_;
57  
58 23 ▶ return num_ge( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 20 23
59  
60 20 for (@$self) {
61 42 ▶ return unless $_ <= $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ <= $test 11 31 42
62 }
63  
64 9 return 1;
65 }
66  
67 11 ▶sub num_lt {
Subroutine num_lt: called CC=4 SCAR=13.9
Pod undocumented
68 11 my ( $self, $test, $switch ) = @_;
69  
70 11 ▶ return num_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 8 11
71  
72 8 for (@$self) {
73 17 ▶ return unless $_ < $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ < $test 6 11 17
74 }
75  
76 2 return 1;
77 }
78  
79 2 ▶sub str_eq {
Subroutine str_eq: called CC=3 SCAR=11.0
Pod undocumented
80 2 my ( $self, $test ) = @_;
81  
82 2 for (@$self) {
83 4 ▶ return unless $_ eq $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ eq $test 1 3 4
84 }
85  
86 1 return 1;
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 unless $_ ne $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ ne $test 1 3 4
94 }
95  
96 1 return 1;
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 10 ▶ return unless $_ ge $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ ge $test 2 8 10
106 }
107  
108 4 return 1;
109 }
110  
111 9 ▶sub str_gt {
Subroutine str_gt: called CC=4 SCAR=13.9
Pod undocumented
112 9 my ( $self, $test, $switch ) = @_;
113  
114 9 ▶ return str_lt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 6 9
115  
116 6 for (@$self) {
117 8 ▶ return unless $_ gt $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ gt $test 4 4 8
118 }
119  
120 2 return 1;
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 10 ▶ return unless $_ le $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ le $test 2 8 10
130 }
131  
132 4 return 1;
133 }
134  
135 9 ▶sub str_lt {
Subroutine str_lt: called CC=4 SCAR=13.9
Pod undocumented
136 9 my ( $self, $test, $switch ) = @_;
137  
138 9 ▶ return str_gt( $self, $test ) if $switch;
Branch: 1 branch
BranchTrueFalseTotal
if $switch 3 6 9
139  
140 6 for (@$self) {
141 8 ▶ return unless $_ lt $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ lt $test 4 4 8
142 }
143  
144 2 return 1;
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 13 ▶ return unless $_ =~ $test;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ =~ /$test/ 3 10 13
152 }
153  
154 2 return 1;
155 }
156  
157 4 ▶sub regex_ne {
Subroutine regex_ne: called CC=3 SCAR=11.0
Pod undocumented
158 4 my ( $self, $test, $switch ) = @_;
159  
160 4 for (@$self) {
161 11 ▶ return unless $_ !~ $test;
Branch: 1 branch
BranchTrueFalseTotal
if $_ =~ /$test/ 2 9 11
162 }
163  
164 2 return 1;
165 }
166  
167 6 ▶sub bool {
Subroutine bool: called CC=3 SCAR=11.0
Pod undocumented
168 6 my ($self) = @_;
169  
170 6 for (@$self) {
171 12 ▶ return unless $_;
Branch: 1 branch
BranchTrueFalseTotal
unless $_ 3 9 12
172 }
173  
174 3 return 1;
175 }
176  
177 8 1;
178  
« Junction/One.pm ↑ Summary Junction/Any.pm »