blib/lib/XML/Grammar/Fiction/FromProto/Node/Element.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 2.9
CC
2
Cov
100%
lookup_attr
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/XML/Grammar/Screenplay/Base.pm ↑ Summary blib/lib/XML/Grammar/Fiction/Struct/Tag.pm »
1 package XML::Grammar::Fiction::FromProto::Node::Element;
2 24 $XML::Grammar::Fiction::FromProto::Node::Element::VERSION = '0.32.0';
3  
4 24 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 24 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 24 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 24 extends("XML::Grammar::Fiction::FromProto::Node::WithContent");
10  
11 24 has 'name' => ( isa => 'Str', is => 'rw' );
12 24 has 'attrs' => ( isa => 'ArrayRef', is => 'rw' );
13 24 has 'open_line' => ( isa => 'Maybe[Int]', is => 'rw' );
14  
15  
16 sub lookup_attr
17 483 ▶{
Subroutine lookup_attr: called CC=2 SCAR=6.9
Pod documented
18 483 my ( $self, $attr_name ) = @_;
19  
20 my $pair =
21 483 ▶ List::Util::first { $_->{key} eq $attr_name } ( @{ $self->attrs() } );
Subroutine __ANON__: called CC=1 SCAR=0.0
22  
23 483 ▶ if ( !defined($pair) )
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $pair) { } 243 240 483
24 {
25 243 return;
26 }
27 else
28 {
29 240 return $pair->{value};
30 }
31 }
32  
33 24 1;
34  
35 __END__
« blib/lib/XML/Grammar/Screenplay/Base.pm ↑ Summary blib/lib/XML/Grammar/Fiction/Struct/Tag.pm »