Block/W2A/CS/FixAtreeAfterMcD.pm

filter: Statementstmt 55.5% 15 / 27 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 40.4% 19 / 47 CC 7 SCAR 35.8
CC
7
Cov
41%
process_atree
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 36.0
« Block/W2A/CS/FixIsMember.pm ↑ Summary Block/W2A/CS/FixReflexiveTantum.pm »
1 package Treex::Block::W2A::CS::FixAtreeAfterMcD;
2 1 $Treex::Block::W2A::CS::FixAtreeAfterMcD::VERSION = '2.20151102';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Treex::Core::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 extends 'Treex::Core::Block';
8  
9 0 ▶sub process_atree {
Subroutine process_atree: not called CC=7 SCAR=40.3
Pod undocumented
10 0 my ( $self, $a_root ) = @_;
11  
12 0 foreach my $a_node ( $a_root->get_descendants ) {
13 0 ▶ if ( $a_node->afun eq "AuxX" || $a_node->afun eq "AuxG" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($a_node->afun eq "AuxX" or $a_node->afun eq "AuxG") 0 0 0
Condition0%0/3
$a_node->afun eq "AuxX" or $a_node->afun eq "AuxG"
l!l&&r!l&&!r
000
MC/DC0%0/2
$a_node->afun eq "AuxX" or $a_node->afun eq "AuxG"
$a_node->afun eq "AuxX" $a_node->afun eq "AuxG"
Truth table0%0/3
A or B
A= $a_node->afun eq "AuxX"B= $a_node->afun eq "AuxG"
ABresult
1X1
011
000
14 0 my @children = $a_node->get_children();
15 0 my $ch = $children[0];
16 0 ▶ if ( defined $ch && $ch->is_member ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ch and $ch->is_member) 0 0 0
Condition0%0/3
defined $ch and $ch->is_member
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ch and $ch->is_member
defined $ch $ch->is_member
Truth table0%0/3
A and B
A= defined $chB= $ch->is_member
ABresult
0X0
100
111
17  
18 # _Co under AuxX => change AuxX to Coord
19 0 $a_node->set_afun('Coord');
20 }
21 }
22 }
23  
24 0 my @root_children = grep { $_->afun ne "AuxK" } $a_root->get_children;
25 0 foreach my $i ( 1 .. $#root_children ) {
26 0 $root_children[$i]->set_parent( $root_children[0] );
27 }
28 0 return;
29 }
30  
31 1 1;
32  
33 __END__
« Block/W2A/CS/FixIsMember.pm ↑ Summary Block/W2A/CS/FixReflexiveTantum.pm »