ParamCheck/Implementation/ParamsCheck/Perl.pm

filter: Statementstmt 100% 33 / 33 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 1 totaltotal 92.8% 52 / 56 CC 6 SCAR 7.6
CC
6
Cov
95%
__ANON__
4.0
__ANON__
3.0
BEGIN
1.0
CRAP 2.1
« ParamCheck/Implementation/RefUtilXS.pm ↑ Summary ParamCheck/Base/ParamsCheck.pm »
1 4 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Benchmark::Featureset::ParamCheck::Implementation::ParamsCheck::Perl;
6  
7 4 our $AUTHORITY = 'cpan:TOBYINK';
8 4 our $VERSION = '0.006';
9  
10 4 ▶use parent qw(Benchmark::Featureset::ParamCheck::Base::ParamsCheck);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 4 ▶use constant long_name => 'Params::Check with coderefs';
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use constant short_name => 'PC-PurePerl';
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 sub get_named_check {
18 state $check = +{
19 integer => { required => 1, allow => qr/\A-?[0-9]+\z/ },
20 hashes => { required => 1, allow => sub {
21 600005 ▶ return unless ref($_[0]) eq 'ARRAY';
Subroutine __ANON__: called CC=4 SCAR=13.9
Branch: 1 branch
BranchTrueFalseTotal
unless ref $_[0] eq "ARRAY" 0 600005 600005
22 600005 for my $arr (@{ $_[0] }) {
23 2000033 ▶ return unless ref($arr) eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $arr eq "HASH" 1 2000032 2000033
24 }
25 600004 return 1;
26 }},
27 object => { required => 1, allow => sub {
28 600005 ▶ blessed($_[0])
Subroutine __ANON__: called CC=3 SCAR=11.1
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_[0]) and $_[0]->can("print") and $_[0]->can("close") 600004 1 600005
Condition66%2/3
builtin::blessed($_[0]) and $_[0]->can("print")
!ll&&!rl&&r
01600004
MC/DC50%1/2
builtin::blessed($_[0]) and $_[0]->can("print")
builtin::blessed($_[0]) $_[0]->can("print")
Truth table66%2/3
A and B
A= builtin::blessed($_[0])B= $_[0]->can("print")
ABresult
0X0
100
111
29 && $_[0]->can('print')
30 && $_[0]->can('close')
31 }},
32 68 ▶ };
Subroutine get_named_check: called CC=1 SCAR=0.0
Pod undocumented
33 }
34  
35 4 1;
« ParamCheck/Implementation/RefUtilXS.pm ↑ Summary ParamCheck/Base/ParamsCheck.pm »