| 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::Perl; | ||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 4 | our $AUTHORITY = 'cpan:TOBYINK'; | |||||||||||||||||||||||||||||||||||||||||
| 8 | 4 | our $VERSION = '0.006'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use parent qw(Benchmark::Featureset::ParamCheck::Base); | ||||||||||||||||||||||||||||||||||||||||
|
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 => 'Naive Pure Perl Implementation'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 4 | ▶ | use constant short_name => 'PurePerl'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | sub get_named_check { | ||||||||||||||||||||||||||||||||||||||||||
| 18 | state $check = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 600018 | ▶ | my %args = (@_==1 && ref($_[0]) eq 'HASH') ? %{$_[0]} : @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=13 SCAR=25.7
Branch: 1 branch
Condition66%2/3
@_ == 1 and ref $_[0] eq "HASH"
MC/DC50%1/2
@_ == 1 and ref $_[0] eq "HASH"
@_ == 1
ref $_[0] eq "HASH"
Truth table66%2/3
A and B
A= @_ == 1B= ref $_[0] eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 600018 | ▶ | die 'invalid key' if grep !/\A(integer|object|hashes)\z/, keys %args; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | die 'bad integer' unless | ||||||||||||||||||||||||||||||||||||||||||
| 23 | defined($args{integer}) | ||||||||||||||||||||||||||||||||||||||||||
| 24 | && !ref($args{integer}) | ||||||||||||||||||||||||||||||||||||||||||
| 25 | 600016 | ▶ | && $args{integer} =~ /\A-?[0-9]+\z/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $args{"integer"} and not ref $args{"integer"} and $args{"integer"} =~ /\A-?[0-9]+\z/u
defined $args{"integer"} and not ref $args{"integer"}
MC/DC66%2/3
defined $args{"integer"} and not ref $args{"integer"} and $args{"integer"} =~ /\A-?[0-9]+\z/u
defined $args{"integer"}
not ref $args{"integer"}
$args{"integer"} =~ /\A-?[0-9]+\z/u
Truth table75%3/4
A and not(B) and C
A= defined $args{"integer"}B= not ref $args{"integer"}C= $args{"integer"} =~ /\A-?[0-9]+\z/u
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | die 'bad object' unless | ||||||||||||||||||||||||||||||||||||||||||
| 28 | blessed($args{object}) | ||||||||||||||||||||||||||||||||||||||||||
| 29 | && $args{object}->can('print') | ||||||||||||||||||||||||||||||||||||||||||
| 30 | 600012 | ▶ | && $args{object}->can('close'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
builtin::blessed($args{"object"}) and $args{"object"}->can("print") and $args{"object"}->can("close")
builtin::blessed($args{"object"}) and $args{"object"}->can("print")
MC/DC66%2/3
builtin::blessed($args{"object"}) and $args{"object"}->can("print") and $args{"object"}->can("close")
builtin::blessed($args{"object"})
$args{"object"}->can("print")
$args{"object"}->can("close")
Truth table75%3/4
A and B and C
A= builtin::blessed($args{"object"})B= $args{"object"}->can("print")C= $args{"object"}->can("close")
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | die 'bad hashes' unless | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 600008 | ▶ | ref($args{hashes}) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 600006 | for my $arr (@{ $args{hashes} }) { | |||||||||||||||||||||||||||||||||||||||||
| 35 | 2000026 | ▶ | die 'bad hashes' unless ref($arr) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 600004 | \%args; | |||||||||||||||||||||||||||||||||||||||||
| 39 | 78 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_named_check: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | sub get_positional_check { | ||||||||||||||||||||||||||||||||||||||||||
| 43 | state $check = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 44 | 800007 | ▶ | die 'wrong number of parameters' unless @_==3; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=11 SCAR=24.8
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 800005 | ▶ | die 'bad integer' unless | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $_[0] and not ref $_[0] and $_[0] =~ /\A-?[0-9]+\z/u
defined $_[0] and not ref $_[0]
MC/DC33%1/3
defined $_[0] and not ref $_[0] and $_[0] =~ /\A-?[0-9]+\z/u
defined $_[0]
not ref $_[0]
$_[0] =~ /\A-?[0-9]+\z/u
Truth table50%2/4
A and not(B) and C
A= defined $_[0]B= not ref $_[0]C= $_[0] =~ /\A-?[0-9]+\z/u
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | defined($_[0]) | ||||||||||||||||||||||||||||||||||||||||||
| 48 | && !ref($_[0]) | ||||||||||||||||||||||||||||||||||||||||||
| 49 | && $_[0] =~ /\A-?[0-9]+\z/; | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 800004 | ▶ | die 'bad object' unless | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
builtin::blessed($_[2]) and $_[2]->can("print") and $_[2]->can("close")
builtin::blessed($_[2]) and $_[2]->can("print")
MC/DC33%1/3
builtin::blessed($_[2]) and $_[2]->can("print") and $_[2]->can("close")
builtin::blessed($_[2])
$_[2]->can("print")
$_[2]->can("close")
Truth table50%2/4
A and B and C
A= builtin::blessed($_[2])B= $_[2]->can("print")C= $_[2]->can("close")
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | blessed($_[2]) | ||||||||||||||||||||||||||||||||||||||||||
| 53 | && $_[2]->can('print') | ||||||||||||||||||||||||||||||||||||||||||
| 54 | && $_[2]->can('close'); | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | 800003 | ▶ | die 'bad hashes' unless | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | ref($_[1]) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 800003 | for my $arr (@{ $_[1] }) { | |||||||||||||||||||||||||||||||||||||||||
| 59 | 2000013 | ▶ | die 'bad hashes' unless ref($arr) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | 800002 | @_; | |||||||||||||||||||||||||||||||||||||||||
| 63 | 87 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_positional_check: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||