Treex/Core/TredView/LineStyles.pm

filter: Statementstmt 69.2% 9 / 13 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 50.0% 11 / 22 CC 3 SCAR 19.0
CC
3
Cov
53%
dash_style
12.0
_build_dash
2.0
BEGIN
1.0
CRAP 6.7
« Treex/Core/Node/Aligned.pm ↑ Summary Treex/Core/Phrase/NTerm.pm »
1 package Treex::Core::TredView::LineStyles;
2 3 $Treex::Core::TredView::LineStyles::VERSION = '2.20210102';
3 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Treex::Core::Log;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 3 has '_dash' => (
8 is => 'ro',
9 isa => 'HashRef[Str]',
10 builder => '_build_dash',
11 );
12  
13 0 ▶sub _build_dash {
Subroutine _build_dash: not called CC=1 SCAR=6.9
14 return {
15 # just alignment lines are dashed, others are plain
16 0 'alignment' => '5,3',
17 'left' => '5,3',
18 'right' => '5,3',
19 'int' => '5,3',
20 'gdfa' => '5,3',
21 'revgdfa' => '5,3',
22 'rule-based' => '5,3',
23 'monolingual' => '5,3',
24 'coref_supervised' => '5,3',
25 'coref_gold' => '5,3',
26 'copy' => '5,3',
27 };
28 }
29  
30  
31 0 ▶sub dash_style {
Subroutine dash_style: not called CC=3 SCAR=24.8
Pod undocumented
32 0 my ( $self, $code ) = @_;
33  
34 # try to truncate complex alignment types to first one (e.g. "gdfa.int.left.right.revgdfa" -> "gdfa")
35 0 ▶ $code =~ s/\..*// if ( not exists $self->_dash->{$code} );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->_dash->{$code} 0 0 0
36 # return dash type or nothing
37 0 ▶ return defined( $self->_dash->{$code} ) ? $self->_dash->{$code} : '' ;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->_dash->{$code} ? : 0 0 0
38 }
39  
40  
41 3 1;
42  
43 __END__
« Treex/Core/Node/Aligned.pm ↑ Summary Treex/Core/Phrase/NTerm.pm »