blib/lib/CXC/PDL/Bin1D/Utils.pm

filter: Statementstmt 56.0% 14 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 58.0% 18 / 31 CC 3 SCAR 16.6
CC
3
Cov
56%
_flags
12.0
_bitflags
2.0
BEGIN
1.0
CRAP 5.2
« blib/lib/CXC/PDL/Bin1D.pm ↑ Summary Bin1D.xs »
1 package CXC::PDL::Bin1D::Utils;
2  
3 5 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 our $VERSION = '0.28';
10  
11 5 our @EXPORT_OK = qw[ _bitflags _flags ];
12  
13 0 ▶sub _bitflags {
Subroutine _bitflags: not called CC=1 SCAR=6.9
14 0 my $bit = 1;
15 ## no critic (BuiltinFunctions::ProhibitComplexMappings)
16 0 return shift(), 1, map { $bit <<= 1; $_ => $bit; } @_;
17 }
18  
19 0 ▶sub _flags {
Subroutine _flags: not called CC=3 SCAR=24.8
20 0 my $bits = shift;
21 0 croak( "unknown flag: $_ " ) for grep { !defined $bits->{$_} } @_;
22 0 my $mask;
23 0 $mask |= $_ for @{$bits}{@_};
24 0 return $mask;
25 }
26  
27 5 1;
28  
29 __END__
« blib/lib/CXC/PDL/Bin1D.pm ↑ Summary Bin1D.xs »