Forest/Tree/Writer/SimpleASCII.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 27 / 27 CC 2 SCAR 3.4
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
as_string
1.0
CRAP 1.4
« Forest/Tree/Builder.pm ↑ Summary Forest/Tree/Roles/HasNodeFormatter.pm »
1 package Forest::Tree::Writer::SimpleASCII;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 4 our $VERSION = '0.10';
5 4 our $AUTHORITY = 'cpan:STEVAN';
6  
7 4 with 'Forest::Tree::Writer',
8 'Forest::Tree::Roles::HasNodeFormatter';
9  
10 12 ▶sub as_string {
Subroutine as_string: called CC=1 SCAR=0.0
Pod documented
11 12 my ($self) = @_;
12 12 my $out;
13  
14 90 return join( "", map { "$_\n" }
15 102 ▶ $self->tree->fmap_cont(sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
16 102 my ( $t, $cont, %args ) = @_;
17  
18 102 ▶ if ( $t->has_node ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($t->has_node) { } 90 12 102
19 return (
20 $self->format_node($t),
21 90 map { " $_" } $cont->(),
22 );
23 } else {
24 12 return $cont->();
25 }
26 12 }),
27 );
28 }
29  
30 4 __PACKAGE__->meta->make_immutable;
31  
32 4 ▶no Moose; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 __END__
« Forest/Tree/Builder.pm ↑ Summary Forest/Tree/Roles/HasNodeFormatter.pm »