Treex/Core/TredView/Common.pm

filter: Statementstmt 55.0% 11 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 55.5% 15 / 27 CC 2 SCAR 7.8
CC
2
Cov
50%
cur_node
3.9
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« Treex/Block/Write/BaseTextWriter.pm ↑ Summary Treex/Core/TredView/BackendStorable.pm »
1 package Treex::Core::TredView::Common;
2 4 $Treex::Core::TredView::Common::VERSION = '2.20210102';
3 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Treex::Core::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub cur_node {
Subroutine cur_node: not called CC=2 SCAR=13.7
Pod documented
7 0 my $node;
8  
9 # TODO: no warnings should be avoided as well as the whole re-blessing
10 {
11 0 ▶ no warnings 'once';
Subroutine BEGIN: called CC=1 SCAR=0.2
12 0 $node = $TredMacro::this;
13 }
14  
15 0 my $layer;
16 0 ▶ if ( $node->type->get_structure_name =~ /(\S)-(root|node|nonterminal|terminal)/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($node->type->get_structure_name =~ /(\S)-(root|node|nonterminal|terminal)/) { } 0 0 0
17 0 $layer = $1;
18 }
19 else {
20 0 return;
21 }
22 0 bless $node, 'Treex::Core::Node::' . uc($layer);
23  
24 0 return $node;
25 }
26  
27 4 1;
28  
29 __END__
« Treex/Block/Write/BaseTextWriter.pm ↑ Summary Treex/Core/TredView/BackendStorable.pm »