Mildew/AST/Block.pm

filter: Statementstmt 44.0% 26 / 59 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 64.7% 11 / 17 Podpod n/a totaltotal 45.1% 37 / 82 CC 6 SCAR 11.9
CC
6
Cov
40%
__ANON__
9.8
__ANON__
4.9
__ANON__
4.7
CRAP 3.3
« VAST/signature.pm ↑ Summary VAST/arglist.pm »
1 4 ▶class Mildew::AST::Block extends Mildew::AST::Base {
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=2.2
2 4 has 'stmts' => (is=>'ro',isa=>'ArrayRef[Mildew::AST::Base]');
3 0 ▶ has 'regs' => (is=>'ro',default=>sub {[]},isa=>'ArrayRef[Str]');
Subroutine __ANON__: not called CC=1 SCAR=1.2
4 0 ▶ method m0ld($ret) {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=1 SCAR=4.9
5 "my $ret = mold {\n"
6 0 . join('',map {'my $'.$_.";\n"} @{$self->regs})
7 0 . join("",map { $_->m0ld('$void') } @{$self->stmts})
8 . "};\n";
9 4 }
10 0 ▶ method pretty {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=2 SCAR=15.9
11 0 ▶ return 'mold {...}' if defined $Mildew::consise_pretty;
Branch: 1 branch
BranchTrueFalseTotal
if defined $Mildew::consise_pretty 0 0 0
12 "mold \{\n". Mildew::AST::indent(
13 0 join('',map {'my $'.$_.";\n"} @{$self->regs})
14 0 . join("",map {Mildew::AST::terminate_stmt $_->pretty } @{$self->stmts})
15 ) . "\}"
16 4 }
17 0 ▶ method simplified {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=3 SCAR=22.8
18 0 my @stmts;
19 my $value;
20 0 for (@{$self->stmts}) {
21 0 my @side_effects;
22 0 ($value,@side_effects) = $_->simplified;
23 0 push (@stmts,@side_effects);
24 }
25 0 ▶ Mildew::AST::Block::Simplified->new(regs=>$self->regs,stmts=>[@stmts,$value ? ($value) : ()]);
Branch: 1 branch
BranchTrueFalseTotal
$value ? : 0 0 0
26 4 }
27 0 ▶ method took {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=2 SCAR=15.1
28 0 my $took = 0;
29 0 for (@{$self->stmts}) {
30 0 $took += $_->took;
31 }
32 0 $took;
33 4 }
34 0 ▶ method forest {
Subroutine BEGIN: called CC=1 SCAR=1.2
Subroutine __ANON__: not called CC=2 SCAR=15.4
35 0 local $Mildew::consise_pretty = 1;
36 0 ▶ Forest::Tree->new(node=> 'mold {...}' . ($Mildew::took ? ' - ' . sprintf("%.4f",$self->took) : ''),children=>[map {$_->forest } @{$self->stmts}]);
Branch: 1 branch
BranchTrueFalseTotal
$Mildew::took ? : 0 0 0
37 4 }
38 4 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
« VAST/signature.pm ↑ Summary VAST/arglist.pm »