lib/Kephra/App/Editor/Property.pm

filter: Statementstmt 13.0% 6 / 46 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 16.6% 2 / 12 Podpod n/a totaltotal 10.5% 8 / 76 CC 10 SCAR 26.0
CC
10
Cov
9%
set_EOL
30.0
get_EOL
20.0
set_tab_size
12.0
CRAP 13.4
« lib/Kephra/App/Editor/Tool.pm ↑ Summary lib/Kephra/App/Editor/View.pm »
1 1 ▶use v5.12;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Kephra::App::Editor::Property;
5  
6 package Kephra::App::Editor;
7  
8  
9  
10 0 ▶sub set_tab_size {
Subroutine set_tab_size: not called CC=3 SCAR=24.8
11 0 my ($self, $size) = @_;
12 0 ▶ return unless defined $size;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $size 0 0 0
13 #$size *= 2 if $^O eq 'darwin';
14 0 $self->SetTabWidth($size);
15 0 $self->SetIndent($size);
16 0 $self->SetHighlightGuide($size);
17 0 $self->{'tab_size'} = $size;
18 0 $self->{'tab_space'} = ' ' x $self->{'tab_size'};
19 0 my $menu = $self->GetParent->GetMenuBar;
20 0 ▶ $menu->Check( 15200 + $size, 1 ) if ref $menu;
Branch: 1 branch
BranchTrueFalseTotal
if ref $menu 0 0 0
21  
22 }
23  
24 0 ▶sub set_tab_usage {
Subroutine set_tab_usage: not called CC=1 SCAR=6.9
25 0 my ($self, $usage) = @_;
26 0 $self->SetUseTabs($usage);
27 }
28  
29 0 ▶sub toggle_tab_usage {
Subroutine toggle_tab_usage: not called CC=1 SCAR=6.9
30 0 my ($self) = @_;
31 0 $self->{'tab_usage'} = !$self->GetUseTabs();
32 0 $self->set_tab_usage( $self->{'tab_usage'} );
33 0 $self->GetParent->GetMenuBar->Check(15100, !$self->{'tab_usage'});
34 }
35  
36  
37 0 ▶sub get_EOL {
Subroutine get_EOL: not called CC=4 SCAR=30.0
38 0 my ($self) = @_;
39 0 my $mode = $self->GetEOLMode();
40 0 ▶ return 'lf' if $mode == &Wx::wxSTC_EOL_LF;
Branch: 1 branch
BranchTrueFalseTotal
if $mode == &Wx::wxSTC_EOL_LF 0 0 0
41 0 ▶ return 'cr' if $mode == &Wx::wxSTC_EOL_CR;
Branch: 1 branch
BranchTrueFalseTotal
if $mode == &Wx::wxSTC_EOL_CR 0 0 0
42 0 ▶ return 'crlf' if $mode == &Wx::wxSTC_EOL_CRLF;
Branch: 1 branch
BranchTrueFalseTotal
if $mode == &Wx::wxSTC_EOL_CRLF 0 0 0
43 0 return '';
44 }
45  
46 0 ▶sub set_EOL {
Subroutine set_EOL: not called CC=5 SCAR=34.0
47 0 my ($self, $mode) = @_;
48 0 ▶ return unless defined $mode;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $mode 0 0 0
49 0 ▶ return $self->set_EOL_lf() if $mode eq 'lf';
Branch: 1 branch
BranchTrueFalseTotal
if $mode eq "lf" 0 0 0
50 0 ▶ return $self->set_EOL_cr() if $mode eq 'cr';
Branch: 1 branch
BranchTrueFalseTotal
if $mode eq "cr" 0 0 0
51 0 ▶ return $self->set_EOL_crlf() if $mode eq 'crlf';
Branch: 1 branch
BranchTrueFalseTotal
if $mode eq "crlf" 0 0 0
52 }
53  
54 0 ▶sub set_EOL_lf {
Subroutine set_EOL_lf: not called CC=1 SCAR=6.9
55 0 my ($self) = @_;
56 0 $self->SetEOLMode( &Wx::wxSTC_EOL_LF );
57 0 $self->ConvertEOLs( &Wx::wxSTC_EOL_LF );
58 0 $self->GetParent->GetMenuBar->Check(15411, 1);
59 }
60  
61 0 ▶sub set_EOL_cr {
Subroutine set_EOL_cr: not called CC=1 SCAR=6.9
62 0 my ($self) = @_;
63 0 $self->SetEOLMode( &Wx::wxSTC_EOL_CR );
64 0 $self->ConvertEOLs( &Wx::wxSTC_EOL_CR );
65 0 $self->GetParent->GetMenuBar->Check(15412, 1);
66 }
67  
68 0 ▶sub set_EOL_crlf {
Subroutine set_EOL_crlf: not called CC=1 SCAR=6.9
69 0 my ($self) = @_;
70 0 $self->SetEOLMode( &Wx::wxSTC_EOL_CRLF );
71 0 $self->ConvertEOLs( &Wx::wxSTC_EOL_CRLF );
72 0 $self->GetParent->GetMenuBar->Check(15413, 1);
73 }
74  
75 0 ▶sub get_encoding {
Subroutine get_encoding: not called CC=1 SCAR=6.9
76 0 my ($self) = @_;
77 }
78  
79 0 ▶sub set_encoding {
Subroutine set_encoding: not called CC=1 SCAR=6.9
80 0 my ($self, $encoding) = @_;
81 }
82  
83  
84 1 1;
« lib/Kephra/App/Editor/Tool.pm ↑ Summary lib/Kephra/App/Editor/View.pm »