blib/lib/Function/Interface/Info/Function.pm

filter: Statementstmt 100% 35 / 35 Branchbran 100% 10 / 10 Conditioncond 100% 11 / 11 MC/DCmcdc 100% 6 / 6 Subroutinesub 100% 12 / 12 Podpod 100% 10 / 10 totaltotal 100% 84 / 84 CC 11 SCAR 8.6
CC
11
Cov
100%
definition
3.0
positional_required
3.0
positional_optional
3.0
CRAP 2.4
« blib/lib/Function/Interface/Types.pm ↑ Summary blib/lib/Function/Interface.pm »
1 package Function::Interface::Info::Function;
2  
3 13 ▶use v5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 13 our $VERSION = "0.04";
7  
8 sub new {
9 125 ▶ my ($class, %args) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
10 125 bless \%args => $class;
11 }
12  
13 114 ▶sub subname() { $_[0]->{subname} }
Subroutine subname: called CC=1 SCAR=0.0
Pod documented
14 46 ▶sub keyword() { $_[0]->{keyword} }
Subroutine keyword: called CC=1 SCAR=0.0
Pod documented
15 109 ▶sub params() { $_[0]->{params} }
Subroutine params: called CC=1 SCAR=0.0
Pod documented
16 36 ▶sub return() { $_[0]->{return} }
Subroutine return: called CC=1 SCAR=0.0
Pod documented
17  
18 sub definition() {
19 15 ▶ my $self = shift;
Subroutine definition: called CC=3 SCAR=11.0
Pod documented
20  
21 sprintf('%s %s(%s) :Return(%s)',
22 $self->keyword,
23 $self->subname,
24 (join ', ', map {
25 6 ▶ sprintf('%s %s%s%s',
Branch: 2 branches
BranchTrueFalseTotal
$_->named ? : 2 4 6
$_->optional ? : 2 4 6
26 $_->type_display_name,
27 $_->named ? ':' : '',
28 $_->name,
29 $_->optional ? '=' : ''
30 )
31 15 } @{$self->params}),
32 (join ', ', map {
33 3 $_->type_display_name,
34 15 } @{$self->return}),
35 );
36 }
37  
38 sub positional_required() {
39 24 ▶ my $self = shift;
Subroutine positional_required: called CC=3 SCAR=11.0
Pod documented
40 24 ▶ $self->{positional_required} //= [ grep { !$_->named && !$_->optional } @{$self->params} ]
Condition100%5/5
$self->{"positional_required"} //= [grep({not $_->named || $_->optional;} @{$self->params;})]
l!l
717
$_->named || $_->optional
l!l&&r!l&&!r
7511
MC/DC100%1/1
$self->{"positional_required"} //= [grep({not $_->named || $_->optional;} @{$self->params;})]
$self->{"positional_required"}
MC/DC100%2/2
$_->named || $_->optional
$_->named $_->optional
Truth table100%2/2
A
A= $self->{"positional_required"}
Aresult
11
00
Truth table100%3/3
A || B
A= $_->namedB= $_->optional
ABresult
1X1
011
000
41 }
42  
43 sub positional_optional() {
44 16 ▶ my $self = shift;
Subroutine positional_optional: called CC=3 SCAR=11.0
Pod documented
45 16 ▶ $self->{positional_optional} //= [ grep { !$_->named && $_->optional } @{$self->params} ]
Branch: 1 branch
BranchTrueFalseTotal
not $_->named and $_->optional 13 7 20
Condition100%2/2
$self->{"positional_optional"} //= [grep({not $_->named and $_->optional;} @{$self->params;})]
l!l
214
MC/DC100%1/1
$self->{"positional_optional"} //= [grep({not $_->named and $_->optional;} @{$self->params;})]
$self->{"positional_optional"}
Truth table100%2/2
A
A= $self->{"positional_optional"}
Aresult
11
00
46 }
47  
48 sub named_required() {
49 15 ▶ my $self = shift;
Subroutine named_required: called CC=3 SCAR=11.0
Pod documented
50 15 ▶ $self->{named_required} //= [ grep { $_->named && !$_->optional } @{$self->params} ]
Branch: 1 branch
BranchTrueFalseTotal
$_->named and not $_->optional 7 12 19
Condition100%2/2
$self->{"named_required"} //= [grep({$_->named and not $_->optional;} @{$self->params;})]
l!l
213
MC/DC100%1/1
$self->{"named_required"} //= [grep({$_->named and not $_->optional;} @{$self->params;})]
$self->{"named_required"}
Truth table100%2/2
A
A= $self->{"named_required"}
Aresult
11
00
51 }
52  
53 sub named_optional() {
54 14 ▶ my $self = shift;
Subroutine named_optional: called CC=3 SCAR=11.0
Pod documented
55 14 ▶ $self->{named_optional} //= [ grep { $_->named && $_->optional } @{$self->params} ]
Branch: 1 branch
BranchTrueFalseTotal
$_->named and $_->optional 6 12 18
Condition100%2/2
$self->{"named_optional"} //= [grep({$_->named and $_->optional;} @{$self->params;})]
l!l
212
MC/DC100%1/1
$self->{"named_optional"} //= [grep({$_->named and $_->optional;} @{$self->params;})]
$self->{"named_optional"}
Truth table100%2/2
A
A= $self->{"named_optional"}
Aresult
11
00
56 }
57  
58 13 1;
59 __END__
« blib/lib/Function/Interface/Types.pm ↑ Summary blib/lib/Function/Interface.pm »