| 1 | 2 | ▶ | use 5.006; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package LINQ::DSL; | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||
| 8 | 2 | our $VERSION = '0.003'; | |||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 2 | ▶ | use LINQ (); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 2 | ▶ | use LINQ::Util -all; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 2 | ▶ | use Exporter::Shiny; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 2 | our %EXPORT_TAGS = ( | |||||||||||||||||||
| 16 | essential => [qw/ | ||||||||||||||||||||
| 17 | Linq From Where Select Join GroupBy ForEach DefaultIfEmpty HashSmush | ||||||||||||||||||||
| 18 | /], | ||||||||||||||||||||
| 19 | join => [qw/ | ||||||||||||||||||||
| 20 | LeftJoin RightJoin InnerJoin OuterJoin GroupJoin | ||||||||||||||||||||
| 21 | /], | ||||||||||||||||||||
| 22 | sort => [qw/ | ||||||||||||||||||||
| 23 | OrderBy OrderByDescending Reverse | ||||||||||||||||||||
| 24 | /], | ||||||||||||||||||||
| 25 | filter => [qw/ | ||||||||||||||||||||
| 26 | Distinct Take TakeWhile Skip SkipWhile | ||||||||||||||||||||
| 27 | /], | ||||||||||||||||||||
| 28 | native => [qw/ | ||||||||||||||||||||
| 29 | ToList ToArray ToDictionary ToIterator | ||||||||||||||||||||
| 30 | /], | ||||||||||||||||||||
| 31 | aggregate => [qw/ | ||||||||||||||||||||
| 32 | Min Max Sum Average Aggregate Any All Contains Count SequenceEqual | ||||||||||||||||||||
| 33 | /], | ||||||||||||||||||||
| 34 | aggregate_safe => [qw/ | ||||||||||||||||||||
| 35 | Min Max Sum Average Aggregate Contains Count SequenceEqual | ||||||||||||||||||||
| 36 | /], | ||||||||||||||||||||
| 37 | field => [qw/ | ||||||||||||||||||||
| 38 | SelectX WhereX field fields check_fields | ||||||||||||||||||||
| 39 | /], | ||||||||||||||||||||
| 40 | type => [qw/ | ||||||||||||||||||||
| 41 | Cast OfType AutoObject | ||||||||||||||||||||
| 42 | /], | ||||||||||||||||||||
| 43 | combine => [qw/ | ||||||||||||||||||||
| 44 | Concat Union Intersect Except Zip | ||||||||||||||||||||
| 45 | /], | ||||||||||||||||||||
| 46 | get => [qw/ | ||||||||||||||||||||
| 47 | First FirstOrDefault Last LastOrDefault | ||||||||||||||||||||
| 48 | Single SingleOrDefault ElementAt ElementAtOrDefault | ||||||||||||||||||||
| 49 | /], | ||||||||||||||||||||
| 50 | default => [qw/ | ||||||||||||||||||||
| 51 | :essential :sort :join :filter :native :aggregate :field :type :combine :get | ||||||||||||||||||||
| 52 | /], | ||||||||||||||||||||
| 53 | default_safe => [qw/ | ||||||||||||||||||||
| 54 | :essential :sort :join :filter :native :aggregate_safe :field :type :combine :get | ||||||||||||||||||||
| 55 | /], | ||||||||||||||||||||
| 56 | ); | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | our @EXPORT = map { | ||||||||||||||||||||
| 59 | 20 | ▶ | /^:(.+)$/ ? @{ $EXPORT_TAGS{$1} } : $_; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 60 | 2 | } @{ $EXPORT_TAGS{'default'} }; | |||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 2 | our @EXPORT_OK = @EXPORT; | |||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | 2 | our $Result; | |||||||||||||||||||
| 65 | 2 | our $Final; | |||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | 1 | ▶ | sub Linq (&) { | ||||||||||||||||||
|
Subroutine
Linq: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||
| 68 | 1 | my $definition = shift; | |||||||||||||||||||
| 69 | 1 | local $Result; | |||||||||||||||||||
| 70 | 1 | local $Final = 0; | |||||||||||||||||||
| 71 | 1 | $definition->(); | |||||||||||||||||||
| 72 | 1 | ▶ | return @$Result if $Final eq 'LIST'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 73 | 0 | return $Result; | |||||||||||||||||||
| 74 | } | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | { | ||||||||||||||||||||
| 77 | 2 | my $ao; | |||||||||||||||||||
| 78 | 1 | ▶ | sub AutoObject () { | ||||||||||||||||||
|
Subroutine
AutoObject: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||||||||||
| 79 | 1 | require Types::Standard; | |||||||||||||||||||
| 80 | 1 | require Object::Adhoc; | |||||||||||||||||||
| 81 | 1 | ▶ | $ao ||= Types::Standard::Object()->plus_coercions( | ||||||||||||||||||
|
Condition33%1/3
$ao ||= Types::Standard::Object()->plus_coercions(Types::Standard::HashRef(), \&Object::Adhoc::object)
MC/DC0%0/2
$ao ||= Types::Standard::Object()->plus_coercions(Types::Standard::HashRef(), \&Object::Adhoc::object)
$ao
Types::Standard::Object()->plus_coercions(Types::Standard::HashRef(), \&Object::Adhoc::object)
Truth table33%1/3
A ||= B
A= $aoB= Types::Standard::Object()->plus_coercions(Types::Standard::HashRef(), \&Object::Adhoc::object)
| |||||||||||||||||||||
| 82 | Types::Standard::HashRef(), \&Object::Adhoc::object, | ||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||
| 84 | } | ||||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 2 | ▶ | sub From ($;$) { | ||||||||||||||||||
|
Subroutine
From: called CC=5 SCAR=21.6
Pod
documented
| |||||||||||||||||||||
| 88 | 1 | my $source = pop; | |||||||||||||||||||
| 89 | 1 | ▶ | my $type = @_ ? shift : 'source'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 1 | ▶ | if ( $type eq 'source' ) { | ||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||
| 92 | 1 | $Result = LINQ::LINQ( $source ); | |||||||||||||||||||
| 93 | } | ||||||||||||||||||||
| 94 | elsif ( $type eq 'range' ) { | ||||||||||||||||||||
| 95 | 0 | $Result = LINQ::Range( @$source ); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | elsif ( $type eq 'repeat' ) { | ||||||||||||||||||||
| 98 | 0 | $Result = LINQ::Repeat( @$source ); | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | else { | ||||||||||||||||||||
| 101 | 0 | die 'unknown source'; | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | 1 | return; | |||||||||||||||||||
| 104 | } | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | 0 | ▶ | sub Where (&) { | ||||||||||||||||||
|
Subroutine
Where: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 107 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 108 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 109 | 0 | $Result = $Result->where( @_ ); | |||||||||||||||||||
| 110 | } | ||||||||||||||||||||
| 111 | |||||||||||||||||||||
| 112 | 0 | ▶ | sub WhereX { | ||||||||||||||||||
|
Subroutine
WhereX: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 113 | 0 | @_ = scalar LINQ::Util::check_fields( @_ ); | |||||||||||||||||||
| 114 | 0 | goto \&Select; | |||||||||||||||||||
| 115 | } | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 1 | ▶ | sub Select (&) { | ||||||||||||||||||
|
Subroutine
Select: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||||||||||
| 118 | 1 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 119 | 1 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 120 | 1 | $Result = $Result->select( @_ ); | |||||||||||||||||||
| 121 | } | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | 1 | ▶ | sub SelectX { | ||||||||||||||||||
|
Subroutine
SelectX: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 124 | 1 | @_ = scalar LINQ::Util::fields( @_ ); | |||||||||||||||||||
| 125 | 1 | goto \&Select; | |||||||||||||||||||
| 126 | } | ||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | 1 | ▶ | sub Join ($;@) { | ||||||||||||||||||
|
Subroutine
Join: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||
| 129 | 1 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 130 | 1 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 131 | 1 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 132 | 1 | $Result = $Result->join( $other, @_ ); | |||||||||||||||||||
| 133 | } | ||||||||||||||||||||
| 134 | |||||||||||||||||||||
| 135 | 1 | ▶ | sub LeftJoin ($;@) { | ||||||||||||||||||
|
Subroutine
LeftJoin: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 136 | 1 | splice( @_, 1, 0, -left ); | |||||||||||||||||||
| 137 | 1 | goto \&Join; | |||||||||||||||||||
| 138 | } | ||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | 0 | ▶ | sub RightJoin ($;@) { | ||||||||||||||||||
|
Subroutine
RightJoin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 141 | 0 | splice( @_, 1, 0, -right ); | |||||||||||||||||||
| 142 | 0 | goto \&Join; | |||||||||||||||||||
| 143 | } | ||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | 0 | ▶ | sub InnerJoin ($;@) { | ||||||||||||||||||
|
Subroutine
InnerJoin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 146 | 0 | splice( @_, 1, 0, -inner ); | |||||||||||||||||||
| 147 | 0 | goto \&Join; | |||||||||||||||||||
| 148 | } | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | 0 | ▶ | sub OuterJoin ($;@) { | ||||||||||||||||||
|
Subroutine
OuterJoin: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 151 | 0 | splice( @_, 1, 0, -outer ); | |||||||||||||||||||
| 152 | 0 | goto \&Join; | |||||||||||||||||||
| 153 | } | ||||||||||||||||||||
| 154 | |||||||||||||||||||||
| 155 | 0 | ▶ | sub GroupJoin ($;@) { | ||||||||||||||||||
|
Subroutine
GroupJoin: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 156 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 157 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 158 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 159 | 0 | $Result = $Result->group_join( $other, @_ ); | |||||||||||||||||||
| 160 | } | ||||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | 0 | ▶ | sub GroupBy (&) { | ||||||||||||||||||
|
Subroutine
GroupBy: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 163 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 164 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 165 | 0 | $Result = $Result->group_by( @_ ); | |||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | |||||||||||||||||||||
| 168 | 0 | ▶ | sub Distinct (&) { | ||||||||||||||||||
|
Subroutine
Distinct: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 169 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 170 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 171 | 0 | $Result = $Result->distinct( @_ ); | |||||||||||||||||||
| 172 | } | ||||||||||||||||||||
| 173 | |||||||||||||||||||||
| 174 | 1 | ▶ | sub OrderBy { | ||||||||||||||||||
|
Subroutine
OrderBy: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||||||||||
| 175 | 1 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 176 | 1 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 177 | 1 | $Result = $Result->order_by( @_ ); | |||||||||||||||||||
| 178 | } | ||||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | 0 | ▶ | sub OrderByDescending { | ||||||||||||||||||
|
Subroutine
OrderByDescending: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 181 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 182 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 183 | 0 | $Result = $Result->order_by_descending( @_ ); | |||||||||||||||||||
| 184 | } | ||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | 0 | ▶ | sub Take ($) { | ||||||||||||||||||
|
Subroutine
Take: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 187 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 188 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 189 | 0 | $Result = $Result->take( @_ ); | |||||||||||||||||||
| 190 | } | ||||||||||||||||||||
| 191 | |||||||||||||||||||||
| 192 | 0 | ▶ | sub TakeWhile (&) { | ||||||||||||||||||
|
Subroutine
TakeWhile: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 193 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 194 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 195 | 0 | $Result = $Result->take_while( @_ ); | |||||||||||||||||||
| 196 | } | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | 0 | ▶ | sub Skip ($) { | ||||||||||||||||||
|
Subroutine
Skip: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 199 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 200 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 201 | 0 | $Result = $Result->skip( @_ ); | |||||||||||||||||||
| 202 | } | ||||||||||||||||||||
| 203 | |||||||||||||||||||||
| 204 | 0 | ▶ | sub SkipWhile (&) { | ||||||||||||||||||
|
Subroutine
SkipWhile: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 205 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 206 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 207 | 0 | $Result = $Result->skip_while( @_ ); | |||||||||||||||||||
| 208 | } | ||||||||||||||||||||
| 209 | |||||||||||||||||||||
| 210 | 0 | ▶ | sub Concat ($) { | ||||||||||||||||||
|
Subroutine
Concat: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 211 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 212 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 213 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 214 | 0 | $Result = $Result->concat( $other, @_ ); | |||||||||||||||||||
| 215 | } | ||||||||||||||||||||
| 216 | |||||||||||||||||||||
| 217 | 0 | ▶ | sub Reverse () { | ||||||||||||||||||
|
Subroutine
Reverse: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 218 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 219 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 220 | 0 | $Result = $Result->reverse(); | |||||||||||||||||||
| 221 | } | ||||||||||||||||||||
| 222 | |||||||||||||||||||||
| 223 | 0 | ▶ | sub Zip { | ||||||||||||||||||
|
Subroutine
Zip: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 224 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 225 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 226 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 227 | 0 | $Result = $Result->zip( $other, @_ ); | |||||||||||||||||||
| 228 | } | ||||||||||||||||||||
| 229 | |||||||||||||||||||||
| 230 | 0 | ▶ | sub DefaultIfEmpty ($) { | ||||||||||||||||||
|
Subroutine
DefaultIfEmpty: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 231 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 232 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 233 | 0 | $Result = $Result->default_if_empty( @_ ); | |||||||||||||||||||
| 234 | } | ||||||||||||||||||||
| 235 | |||||||||||||||||||||
| 236 | 1 | ▶ | sub Cast ($) { | ||||||||||||||||||
|
Subroutine
Cast: called CC=3 SCAR=11.7
Pod
documented
| |||||||||||||||||||||
| 237 | 1 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 238 | 1 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 239 | 1 | $Result = $Result->cast( @_ ); | |||||||||||||||||||
| 240 | } | ||||||||||||||||||||
| 241 | |||||||||||||||||||||
| 242 | 0 | ▶ | sub OfType ($) { | ||||||||||||||||||
|
Subroutine
OfType: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 243 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 244 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 245 | 0 | $Result = $Result->of_type( @_ ); | |||||||||||||||||||
| 246 | } | ||||||||||||||||||||
| 247 | |||||||||||||||||||||
| 248 | 0 | ▶ | sub Min (&) { | ||||||||||||||||||
|
Subroutine
Min: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 249 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 250 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 251 | 0 | $Result = $Result->min( @_ ); | |||||||||||||||||||
| 252 | } | ||||||||||||||||||||
| 253 | |||||||||||||||||||||
| 254 | 0 | ▶ | sub Max (&) { | ||||||||||||||||||
|
Subroutine
Max: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 255 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 256 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 257 | 0 | $Result = $Result->max( @_ ); | |||||||||||||||||||
| 258 | } | ||||||||||||||||||||
| 259 | |||||||||||||||||||||
| 260 | 0 | ▶ | sub Sum (&) { | ||||||||||||||||||
|
Subroutine
Sum: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 261 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 262 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 263 | 0 | $Result = $Result->sum( @_ ); | |||||||||||||||||||
| 264 | } | ||||||||||||||||||||
| 265 | |||||||||||||||||||||
| 266 | 0 | ▶ | sub Average (&) { | ||||||||||||||||||
|
Subroutine
Average: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 267 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 268 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 269 | 0 | $Result = $Result->average( @_ ); | |||||||||||||||||||
| 270 | } | ||||||||||||||||||||
| 271 | |||||||||||||||||||||
| 272 | 0 | ▶ | sub Aggregate (&;@) { | ||||||||||||||||||
|
Subroutine
Aggregate: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 273 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 274 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 275 | 0 | $Result = $Result->aggregate( @_ ); | |||||||||||||||||||
| 276 | } | ||||||||||||||||||||
| 277 | |||||||||||||||||||||
| 278 | 0 | ▶ | sub First (&) { | ||||||||||||||||||
|
Subroutine
First: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 279 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 280 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 281 | 0 | $Result = $Result->first( @_ ); | |||||||||||||||||||
| 282 | } | ||||||||||||||||||||
| 283 | |||||||||||||||||||||
| 284 | 0 | ▶ | sub FirstOrDefault (&$) { | ||||||||||||||||||
|
Subroutine
FirstOrDefault: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 285 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 286 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 287 | 0 | $Result = $Result->first_or_default( @_ ); | |||||||||||||||||||
| 288 | } | ||||||||||||||||||||
| 289 | |||||||||||||||||||||
| 290 | 0 | ▶ | sub Last (&) { | ||||||||||||||||||
|
Subroutine
Last: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 291 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 292 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 293 | 0 | $Result = $Result->last( @_ ); | |||||||||||||||||||
| 294 | } | ||||||||||||||||||||
| 295 | |||||||||||||||||||||
| 296 | 0 | ▶ | sub LastOrDefault (&$) { | ||||||||||||||||||
|
Subroutine
LastOrDefault: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 297 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 298 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 299 | 0 | $Result = $Result->last_or_default( @_ ); | |||||||||||||||||||
| 300 | } | ||||||||||||||||||||
| 301 | |||||||||||||||||||||
| 302 | 0 | ▶ | sub Single (&) { | ||||||||||||||||||
|
Subroutine
Single: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 303 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 304 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 305 | 0 | $Result = $Result->single( @_ ); | |||||||||||||||||||
| 306 | } | ||||||||||||||||||||
| 307 | |||||||||||||||||||||
| 308 | 0 | ▶ | sub SingleOrDefault (&$) { | ||||||||||||||||||
|
Subroutine
SingleOrDefault: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 309 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 310 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 311 | 0 | $Result = $Result->single_or_default( @_ ); | |||||||||||||||||||
| 312 | } | ||||||||||||||||||||
| 313 | |||||||||||||||||||||
| 314 | 0 | ▶ | sub ElementAt (&) { | ||||||||||||||||||
|
Subroutine
ElementAt: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 315 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 316 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 317 | 0 | $Result = $Result->element_at( @_ ); | |||||||||||||||||||
| 318 | } | ||||||||||||||||||||
| 319 | |||||||||||||||||||||
| 320 | 0 | ▶ | sub ElementAtOrDefault (&$) { | ||||||||||||||||||
|
Subroutine
ElementAtOrDefault: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 321 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 322 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 323 | 0 | $Result = $Result->element_at_or_default( @_ ); | |||||||||||||||||||
| 324 | } | ||||||||||||||||||||
| 325 | |||||||||||||||||||||
| 326 | 0 | ▶ | sub Any (&) { | ||||||||||||||||||
|
Subroutine
Any: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 327 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 328 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 329 | 0 | $Result = $Result->any( @_ ); | |||||||||||||||||||
| 330 | } | ||||||||||||||||||||
| 331 | |||||||||||||||||||||
| 332 | 0 | ▶ | sub All (&) { | ||||||||||||||||||
|
Subroutine
All: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 333 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 334 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 335 | 0 | $Result = $Result->all( @_ ); | |||||||||||||||||||
| 336 | } | ||||||||||||||||||||
| 337 | |||||||||||||||||||||
| 338 | 0 | ▶ | sub Contains { | ||||||||||||||||||
|
Subroutine
Contains: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 339 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 340 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 341 | 0 | $Result = $Result->contains( @_ ); | |||||||||||||||||||
| 342 | } | ||||||||||||||||||||
| 343 | |||||||||||||||||||||
| 344 | 0 | ▶ | sub Count () { | ||||||||||||||||||
|
Subroutine
Count: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 345 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 346 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 347 | 0 | $Result = $Result->count(); | |||||||||||||||||||
| 348 | } | ||||||||||||||||||||
| 349 | |||||||||||||||||||||
| 350 | 1 | ▶ | sub ToList () { | ||||||||||||||||||
|
Subroutine
ToList: called CC=3 SCAR=11.4
Pod
documented
| |||||||||||||||||||||
| 351 | 1 | ▶ | die if $Final; $Final = 'LIST'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 352 | 1 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 353 | 1 | $Result = [ $Result->to_list() ]; | |||||||||||||||||||
| 354 | } | ||||||||||||||||||||
| 355 | |||||||||||||||||||||
| 356 | 0 | ▶ | sub ToArray () { | ||||||||||||||||||
|
Subroutine
ToArray: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 357 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 358 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 359 | 0 | $Result = $Result->to_array(); | |||||||||||||||||||
| 360 | } | ||||||||||||||||||||
| 361 | |||||||||||||||||||||
| 362 | 0 | ▶ | sub ToDictionary (&) { | ||||||||||||||||||
|
Subroutine
ToDictionary: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 363 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 364 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 365 | 0 | $Result = $Result->to_dictionary( @_ ); | |||||||||||||||||||
| 366 | } | ||||||||||||||||||||
| 367 | |||||||||||||||||||||
| 368 | 0 | ▶ | sub ToIterator () { | ||||||||||||||||||
|
Subroutine
ToIterator: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 369 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 370 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 371 | 0 | $Result = $Result->to_iterator(); | |||||||||||||||||||
| 372 | } | ||||||||||||||||||||
| 373 | |||||||||||||||||||||
| 374 | 0 | ▶ | sub ForEach (&) { | ||||||||||||||||||
|
Subroutine
ForEach: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 375 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 376 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 377 | 0 | $Result->foreach( @_ ); | |||||||||||||||||||
| 378 | } | ||||||||||||||||||||
| 379 | |||||||||||||||||||||
| 380 | 0 | ▶ | sub Union { | ||||||||||||||||||
|
Subroutine
Union: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 381 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 382 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 383 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 384 | 0 | $Result = $Result->union( $other, @_ ); | |||||||||||||||||||
| 385 | } | ||||||||||||||||||||
| 386 | |||||||||||||||||||||
| 387 | 0 | ▶ | sub Intersect { | ||||||||||||||||||
|
Subroutine
Intersect: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 388 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 389 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 390 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 391 | 0 | $Result = $Result->intersect( $other, @_ ); | |||||||||||||||||||
| 392 | } | ||||||||||||||||||||
| 393 | |||||||||||||||||||||
| 394 | 0 | ▶ | sub Except { | ||||||||||||||||||
|
Subroutine
Except: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 395 | 0 | ▶ | die if $Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 396 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 397 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 398 | 0 | $Result = $Result->except( $other, @_ ); | |||||||||||||||||||
| 399 | } | ||||||||||||||||||||
| 400 | |||||||||||||||||||||
| 401 | 0 | ▶ | sub SequenceEqual { | ||||||||||||||||||
|
Subroutine
SequenceEqual: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||
| 402 | 0 | ▶ | die if $Final; ++$Final; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 403 | 0 | ▶ | die unless $Result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 404 | 0 | my $other = LINQ::LINQ( shift ); | |||||||||||||||||||
| 405 | 0 | $Result = $Result->sequence_equal( $other, @_ ); | |||||||||||||||||||
| 406 | } | ||||||||||||||||||||
| 407 | |||||||||||||||||||||
| 408 | 1 | ▶ | sub HashSmush { | ||||||||||||||||||
|
Subroutine
HashSmush: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 409 | 1 | require Object::Adhoc; | |||||||||||||||||||
| 410 | 5 | ▶ | return sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 411 | 5 | my %smushed = map %$_, grep defined, reverse @_; | |||||||||||||||||||
| 412 | 5 | Object::Adhoc::object(\%smushed); | |||||||||||||||||||
| 413 | } | ||||||||||||||||||||
| 414 | 1 | } | |||||||||||||||||||
| 415 | |||||||||||||||||||||
| 416 | 2 | 1; | |||||||||||||||||||
| 417 | |||||||||||||||||||||
| 418 | __END__ | ||||||||||||||||||||