blib/lib/XML/Grammar/Fiction/Struct/Tag.pm

filter: Statementstmt 92.3% 36 / 39 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 4 / 4 totaltotal 90.9% 50 / 55 CC 2 SCAR 2.5
CC
2
Cov
90%
append_children
2.0
line_idx
2.0
__ANON__
1.0
CRAP 1.3
« blib/lib/XML/Grammar/Fiction/FromProto/Node/Element.pm ↑ Summary blib/lib/XML/Grammar/Screenplay/API/ImageListDoc.pm »
1 package XML::Grammar::Fiction::Struct::Tag;
2 22 $XML::Grammar::Fiction::Struct::Tag::VERSION = '0.32.0';
3 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 22 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 ▶use List::MoreUtils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 22 has 'name' => ( is => "rw", isa => "Str" );
12 22 has 'line' => ( is => "rw", isa => "Int" );
13 22 has 'is_standalone' => ( is => "rw", isa => "Bool" );
14 22 has 'attrs' => ( is => "rw", isa => "ArrayRef" );
15 22 has 'children' => (
16 is => "rw",
17 isa => "Maybe[ArrayRef]",
18 );
19  
20 sub line_idx
21 0 ▶{
Subroutine line_idx: not called CC=1 SCAR=6.9
Pod documented
22 0 my ( $self, ) = @_;
23  
24 0 return $self->line();
25 }
26  
27 sub append_children
28 1576 ▶{
Subroutine append_children: called CC=2 SCAR=7.1
Pod documented
29 1576 my ( $self, $children ) = @_;
30  
31 # This is an assert / sanity check.
32 1576 ▶ if ( List::MoreUtils::any { !defined($_) } @$children )
Subroutine __ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
BranchTrueFalseTotal
if (&List::MoreUtils::any(sub { not defined $_; } , @$children)) 0 1576 1576
33 {
34 0 Carp::confess("append_children with undef.");
35 }
36  
37 1576 push @{ $self->children() }, @$children;
38  
39 1576 return;
40 }
41  
42 sub append_child
43 1576 ▶{
Subroutine append_child: called CC=1 SCAR=0.0
Pod documented
44 1576 my ( $self, $child ) = @_;
45  
46 1576 return $self->append_children( [$child] );
47 }
48  
49 sub detach_children
50 942 ▶{
Subroutine detach_children: called CC=1 SCAR=0.0
Pod documented
51 942 my $self = shift;
52  
53 942 my $children = $self->children();
54  
55 942 $self->children(undef);
56  
57 942 return $children;
58 }
59  
60 package XML::Grammar::Fiction::Struct::Tag::Para;
61 22 $XML::Grammar::Fiction::Struct::Tag::Para::VERSION = '0.32.0';
62 22 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
63  
64 22 extends("XML::Grammar::Fiction::Struct::Tag");
65  
66  
67 22 1;
68  
69 __END__
« blib/lib/XML/Grammar/Fiction/FromProto/Node/Element.pm ↑ Summary blib/lib/XML/Grammar/Screenplay/API/ImageListDoc.pm »