| 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::Position; | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | package Kephra::App::Editor; | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub line_start { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
line_start: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 0 | my $line = $self->LineFromPosition( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | return -1 if $line == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | $self->GetLineIndentPosition( $line ); | |||||||||||||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub word_edges_expand { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
word_edges_expand: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ($self->WordStartPosition( $pos, 1 ), $self->WordEndPosition( $pos, 1 ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub word_edges_shrink { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
word_edges_shrink: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my ($self, $pos, $anchor) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | $anchor = $self->GetAnchor unless defined $anchor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | my $char = $self->GetCharAt( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if ($pos > $anchor) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | my $npos = $pos; | |||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | unless ($self->WordEndPosition( $pos-1, 1 ) == $pos){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | $npos = $self->WordStartPosition( $pos, 1 ) unless $char == 32; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $self->GotoPos( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | $npos = $self->SearchPrev( &Wx::wxSTC_FIND_REGEXP, '\S'); | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | $npos++; | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my $nstart = $self->WordStartPosition( $npos-1, 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | return ($nstart >= $anchor) ? ( $nstart, $npos ) : ($pos, $pos); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | my $npos = $pos; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | unless ($self->WordStartPosition( $pos, 1 ) == $pos){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | $npos = $self->WordEndPosition( $pos, 1 ) unless $char == 32; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | $self->GotoPos( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $npos = $self->SearchNext( &Wx::wxSTC_FIND_REGEXP, '\S'); | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my $nend = $self->WordEndPosition( $npos+1, 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | return ($nend <= $anchor) ? ( $npos, $nend ) : ($pos, $pos); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | sub block_edges_expand { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
block_edges_expand: not called CC=14 SCAR=53.5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | $sel_start = $self->GetCurrentPos unless defined $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | $sel_end //= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sel_end //= $sel_start
MC/DC0%0/2
$sel_end //= $sel_start
$sel_end
$sel_start
Truth table0%0/3
A //= B
A= $sel_endB= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | my $line_nr = $self->LineFromPosition( $sel_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | return unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | $line_nr-- while $line_nr > 0 and $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$line_nr > 0 and $self->GetLine($line_nr) =~ /\S/u
MC/DC0%0/2
$line_nr > 0 and $self->GetLine($line_nr) =~ /\S/u
$line_nr > 0
$self->GetLine($line_nr) =~ /\S/u
Truth table0%0/3
A and B
A= $line_nr > 0B= $self->GetLine($line_nr) =~ /\S/u
| |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | $line_nr++ unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | my $block_start = $self->PositionFromLine( $line_nr ); | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | my $last_line_nr = $self->GetLineCount - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | $line_nr = $self->LineFromPosition( $sel_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | $line_nr++ while $line_nr < $last_line_nr and $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$line_nr < $last_line_nr and $self->GetLine($line_nr) =~ /\S/u
MC/DC0%0/2
$line_nr < $last_line_nr and $self->GetLine($line_nr) =~ /\S/u
$line_nr < $last_line_nr
$self->GetLine($line_nr) =~ /\S/u
Truth table0%0/3
A and B
A= $line_nr < $last_line_nrB= $self->GetLine($line_nr) =~ /\S/u
| |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | $line_nr-- unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | my $block_end = $self->GetLineEndPosition( $line_nr ); | |||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | return if $block_end < $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | return if $sel_start == $block_start and $sel_end == $block_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sel_start == $block_start and $sel_end == $block_end
MC/DC0%0/2
$sel_start == $block_start and $sel_end == $block_end
$sel_start == $block_start
$sel_end == $block_end
Truth table0%0/3
A and B
A= $sel_start == $block_startB= $sel_end == $block_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ($block_start, $block_end); | |||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | sub block_edges_shrink { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
block_edges_shrink: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | my ($self, $pos, $anchor) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | $anchor = $self->GetAnchor unless defined $anchor; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | #~ $sel_end //= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||||
| 77 | #~ ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||||
| 78 | #~ my $line_nr = $self->LineFromPosition( $sel_start ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 79 | #~ return unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||
| 80 | #~ $line_nr-- while $line_nr > 0 and $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||
| 81 | #~ $line_nr++ unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||
| 82 | #~ my $block_start = $self->PositionFromLine( $line_nr ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 83 | #~ my $last_line_nr = $self->GetLineCount - 1; | ||||||||||||||||||||||||||||||||||||||||||||||
| 84 | #~ $line_nr = $self->LineFromPosition( $sel_start ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 85 | #~ $line_nr++ while $line_nr < $last_line_nr and $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||
| 86 | #~ $line_nr-- unless $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||
| 87 | #~ my $block_end = $self->GetLineEndPosition( $line_nr ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 88 | #~ return if $block_end < $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||||
| 89 | #~ return if $sel_start == $block_start and $sel_end == $block_end; | ||||||||||||||||||||||||||||||||||||||||||||||
| 90 | #~ ($block_start, $block_end); | ||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | sub style_edges { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
style_edges: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $sel_start = $self->GetCurrentPos unless defined $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | $sel_end //= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sel_end //= $sel_start
MC/DC0%0/2
$sel_end //= $sel_start
$sel_end
$sel_start
Truth table0%0/3
A //= B
A= $sel_endB= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | my ($style_start, $style_end) = ($sel_start, $sel_start); | |||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | my $style = $self->GetStyleAt( $sel_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | $style_start-- while $style_start and $self->GetStyleAt( $style_start ) == $style; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$style_start and $self->GetStyleAt($style_start) == $style
MC/DC0%0/2
$style_start and $self->GetStyleAt($style_start) == $style
$style_start
$self->GetStyleAt($style_start) == $style
Truth table0%0/3
A and B
A= $style_startB= $self->GetStyleAt($style_start) == $style
| |||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | $style_start++ if $self->GetStyleAt( $style_start ) != $style; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | my $last_pos = $self->GetTextLength - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | $style_end++ while $style_end < $last_pos and $self->GetStyleAt( $style_end ) == $style; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$style_end < $last_pos and $self->GetStyleAt($style_end) == $style
MC/DC0%0/2
$style_end < $last_pos and $self->GetStyleAt($style_end) == $style
$style_end < $last_pos
$self->GetStyleAt($style_end) == $style
Truth table0%0/3
A and B
A= $style_end < $last_posB= $self->GetStyleAt($style_end) == $style
| |||||||||||||||||||||||||||||||||||||||||||||||
| 103 | # $style_end-- if $self->GetStyleAt( $style_end ) != $style; | ||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | return if $style_start == $sel_start and $style_end == $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$style_start == $sel_start and $style_end == $sel_end
MC/DC0%0/2
$style_start == $sel_start and $style_end == $sel_end
$style_start == $sel_start
$style_end == $sel_end
Truth table0%0/3
A and B
A= $style_start == $sel_startB= $style_end == $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | return ($style_start, $style_end) if $style_end >= $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | sub brace_edges_expand { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
brace_edges_expand: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | my ($self, $sel_start, $sel_end, $line) = @_; # look only in $line if defined | |||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | $sel_start = $self->GetCurrentPos unless defined $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | $sel_end //= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sel_end //= $sel_start
MC/DC0%0/2
$sel_end //= $sel_start
$sel_end
$sel_start
Truth table0%0/3
A //= B
A= $sel_endB= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | $self->GotoPos( $sel_start); | |||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | my $npos = $self->SearchPrev( &Wx::wxSTC_FIND_REGEXP, '[([{]'); | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | return if defined $line and $line != $self->LineFromPosition( $npos ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $line and $line != $self->LineFromPosition($npos)
MC/DC0%0/2
defined $line and $line != $self->LineFromPosition($npos)
defined $line
$line != $self->LineFromPosition($npos)
Truth table0%0/3
A and B
A= defined $lineB= $line != $self->LineFromPosition($npos)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | my $match = $self->BraceMatch( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | return if $match < 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | return if defined $line and $line != $self->LineFromPosition( $match ); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $line and $line != $self->LineFromPosition($match)
MC/DC0%0/2
defined $line and $line != $self->LineFromPosition($match)
defined $line
$line != $self->LineFromPosition($match)
Truth table0%0/3
A and B
A= defined $lineB= $line != $self->LineFromPosition($match)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | return if $npos > $sel_end or $match <= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $sel_end or $match <= $sel_start
MC/DC0%0/2
$npos > $sel_end or $match <= $sel_start
$npos > $sel_end
$match <= $sel_start
Truth table0%0/3
A or B
A= $npos > $sel_endB= $match <= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ($npos, $match+1); | |||||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | sub brace_edges_shrink { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
brace_edges_shrink: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | return () unless defined $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $self->GotoPos( $sel_start + 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | my $npos = $self->SearchNext( &Wx::wxSTC_FIND_REGEXP, '[([{]'); | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | return () if $npos < 0 or $npos >= $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos < 0 or $npos >= $sel_end
MC/DC0%0/2
$npos < 0 or $npos >= $sel_end
$npos < 0
$npos >= $sel_end
Truth table0%0/3
A or B
A= $npos < 0B= $npos >= $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $match = $self->BraceMatch( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | return if $match < 0 or $match >= $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$match < 0 or $match >= $sel_end
MC/DC0%0/2
$match < 0 or $match >= $sel_end
$match < 0
$match >= $sel_end
Truth table0%0/3
A or B
A= $match < 0B= $match >= $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ($npos, $match+1); | |||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | sub loop_edges_expand { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loop_edges_expand: not called CC=27 SCAR=66.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | $sel_start = $self->GetCurrentPos unless defined $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | $sel_end //= $sel_start; # $self->GetStyleAt( $pos); 5 | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sel_end //= $sel_start
MC/DC0%0/2
$sel_end //= $sel_start
$sel_end
$sel_start
Truth table0%0/3
A //= B
A= $sel_endB= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | my $search_start = $sel_start; | |||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | my $line_start = $self->line_start( $sel_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | $search_start = $line_start if $line_start > $search_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $loop_start = -1; | |||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | my $npos; | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $self->GotoPos( $search_start + 5 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | $npos = $self->SearchPrev( 0, 'for'); | |||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $npos = $self->SearchPrev( 0, 'foreach'); | |||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | $npos = $self->SearchPrev( 0, 'until'); | |||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | $npos = $self->SearchPrev( 0, 'while'); | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | return if $loop_start == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | my @edges = $self->loop_edges( $loop_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | return unless @edges and $edges[1] >= $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@edges and $edges[1] >= $sel_end
MC/DC0%0/2
@edges and $edges[1] >= $sel_end
@edges
$edges[1] >= $sel_end
Truth table0%0/3
A and B
A= @edgesB= $edges[1] >= $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | return @edges if $edges[0] < $sel_start or $edges[1] > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$edges[0] < $sel_start or $edges[1] > $sel_end
MC/DC0%0/2
$edges[0] < $sel_start or $edges[1] > $sel_end
$edges[0] < $sel_start
$edges[1] > $sel_end
Truth table0%0/3
A or B
A= $edges[0] < $sel_startB= $edges[1] > $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $self->GotoPos( $loop_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | $loop_start = -1; | |||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | $npos = $self->SearchPrev( 0, 'for'); | |||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | $npos = $self->SearchPrev( 0, 'foreach'); | |||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | $npos = $self->SearchPrev( 0, 'until'); | |||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | $npos = $self->SearchPrev( 0, 'while'); | |||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | return unless $loop_start > -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | $self->loop_edges( $loop_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | sub loop_edges_shrink { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loop_edges_shrink: not called CC=22 SCAR=62.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | return () unless defined $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | my $search_start = $sel_start; | |||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | my $line_start = $self->line_start( $sel_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | $search_start = $line_start if $line_start > $search_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $loop_start = -1; | |||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | my $npos; | |||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $self->GotoPos( $sel_start - 5); | |||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | $npos = $self->SearchNext( 0, 'for'); | |||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | $npos = $self->SearchNext( 0, 'until'); | |||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | $npos = $self->SearchNext( 0, 'while'); | |||||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | return if $loop_start == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | my @edges = $self->loop_edges( $loop_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | return unless @edges and $edges[1] <= $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@edges and $edges[1] <= $sel_end
MC/DC0%0/2
@edges and $edges[1] <= $sel_end
@edges
$edges[1] <= $sel_end
Truth table0%0/3
A and B
A= @edgesB= $edges[1] <= $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | return @edges if $edges[0] > $sel_start or $edges[1] < $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$edges[0] > $sel_start or $edges[1] < $sel_end
MC/DC0%0/2
$edges[0] > $sel_start or $edges[1] < $sel_end
$edges[0] > $sel_start
$edges[1] < $sel_end
Truth table0%0/3
A or B
A= $edges[0] > $sel_startB= $edges[1] < $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $search_start = $loop_start; | |||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->GotoPos( $search_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | $loop_start = -1; | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | $npos = $self->SearchNext( 0, 'for'); | |||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | $npos = $self->SearchNext( 0, 'until'); | |||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | $npos = $self->SearchNext( 0, 'while'); | |||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | $loop_start = $npos if $npos > $loop_start and $self->GetStyleAt( $npos ) == 5; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$npos > $loop_start and $self->GetStyleAt($npos) == 5
MC/DC0%0/2
$npos > $loop_start and $self->GetStyleAt($npos) == 5
$npos > $loop_start
$self->GetStyleAt($npos) == 5
Truth table0%0/3
A and B
A= $npos > $loop_startB= $self->GetStyleAt($npos) == 5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | ▶ | return if $loop_start == $search_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | @edges = $self->loop_edges( $loop_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | return $edges[1] > $sel_end; | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | @edges; | |||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | sub loop_edges { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
loop_edges: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | my ($self, $start) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $self->GotoPos( $start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my $npos = $self->SearchNext( 0, '('); | |||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | return if $npos == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | my $match = $self->BraceMatch( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | return if $match == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | $npos = $self->SearchNext( 0, '{'); | |||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | return if $npos == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | $match = $self->BraceMatch( $npos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | ▶ | return if $match == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ($self->PositionFromLine( $self->LineFromPosition( $start )), $match+1); | |||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | ▶ | sub sub_edges_expand { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sub_edges_expand: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | ▶ | $sel_start = $self->GetCurrentPos unless defined $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | $sel_end //= $sel_start; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$sel_end //= $sel_start
MC/DC0%0/2
$sel_end //= $sel_start
$sel_end
$sel_start
Truth table0%0/3
A //= B
A= $sel_endB= $sel_start
| |||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | my $start_line = $self->prev_sub( $sel_start + 5 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | return if $start_line == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | my $sub_start = $self->PositionFromLine( $self->LineFromPosition( $start_line ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | $self->GotoPos( $sub_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | my $bpos = $self->SearchNext( 0, '{'); | |||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | return if $bpos == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | my $sub_end = $self->BraceMatch( $bpos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | return if $sub_end == -1 or $sub_end < $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sub_end == -1 or $sub_end < $sel_end
MC/DC0%0/2
$sub_end == -1 or $sub_end < $sel_end
$sub_end == -1
$sub_end < $sel_end
Truth table0%0/3
A or B
A= $sub_end == -1B= $sub_end < $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | return if $sub_start == $sel_start and $sub_end == $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sub_start == $sel_start and $sub_end == $sel_end
MC/DC0%0/2
$sub_start == $sel_start and $sub_end == $sel_end
$sub_start == $sel_start
$sub_end == $sel_end
Truth table0%0/3
A and B
A= $sub_start == $sel_startB= $sub_end == $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | ($sub_start, $sub_end+1); | |||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | sub sub_edges_shrink { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sub_edges_shrink: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | my ($self, $sel_start, $sel_end) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | return () unless defined $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | ($sel_start, $sel_end) = ($sel_end, $sel_start) if $sel_start > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $start_line = $self->next_sub( $sel_start); | |||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | return if $start_line < 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | my $sub_start = $self->PositionFromLine( $self->LineFromPosition( $start_line ) ); | |||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | $self->GotoPos( $sub_start ); | |||||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | my $bpos = $self->SearchNext( 0, '{'); | |||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | return if $bpos == -1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | my $sub_end = $self->BraceMatch( $bpos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | return if $sub_end == -1 or $sub_end > $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sub_end == -1 or $sub_end > $sel_end
MC/DC0%0/2
$sub_end == -1 or $sub_end > $sel_end
$sub_end == -1
$sub_end > $sel_end
Truth table0%0/3
A or B
A= $sub_end == -1B= $sub_end > $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | return if $sub_start == $sel_start and $sub_end == $sel_end; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$sub_start == $sel_start and $sub_end == $sel_end
MC/DC0%0/2
$sub_start == $sel_start and $sub_end == $sel_end
$sub_start == $sel_start
$sub_end == $sel_end
Truth table0%0/3
A and B
A= $sub_start == $sel_startB= $sub_end == $sel_end
| |||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ($sub_start, $sub_end+1); | |||||||||||||||||||||||||||||||||||||||||||||
| 260 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | sub get_prev_block_start { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_prev_block_start: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my $line_nr = $self->LineFromPosition( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | return 0 if $line_nr == 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | unless ( $self->GetLine( --$line_nr ) =~ /\S/ ){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | ▶ | while ($line_nr > 0){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | ▶ | last if $self->GetLine( $line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | $line_nr--; | |||||||||||||||||||||||||||||||||||||||||||||
| 270 | } } | ||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | while ($line_nr > 0){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | last unless $self->GetLine( $line_nr - 1 ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | $line_nr--; | |||||||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | $line_nr; | |||||||||||||||||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | sub get_next_block_start { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_next_block_start: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | my $line_nr = $self->LineFromPosition( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | my $last_line_nr = $self->GetLineCount - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | return $line_nr if $line_nr == $last_line_nr; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | if ( $self->GetLine( ++$line_nr ) =~ /\S/ ){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | while ($line_nr < $last_line_nr){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | ▶ | last unless $self->GetLine( ++$line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 285 | } } | ||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | ▶ | while ($line_nr < $last_line_nr){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | ▶ | last if $self->GetLine( ++$line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | $line_nr; | |||||||||||||||||||||||||||||||||||||||||||||
| 290 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 0 | ▶ | sub get_prev_block_end { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_prev_block_end: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | my $line_nr = $self->LineFromPosition( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | return 0 if $line_nr == 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | if ( $self->GetLine( --$line_nr ) =~ /\S/ ){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | ▶ | while ($line_nr > 0){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | last unless $self->GetLine( --$line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } } | ||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | while ($line_nr > 0){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | last if $self->GetLine( --$line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $line_nr; | |||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | sub get_next_block_end { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_next_block_end: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my $line_nr = $self->LineFromPosition( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | my $last_line_nr = $self->GetLineCount - 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | ▶ | return $line_nr if $line_nr == $last_line_nr; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | unless ( $self->GetLine( ++$line_nr ) =~ /\S/ ){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | while ($line_nr < $last_line_nr){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | last if $self->GetLine( ++$line_nr ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } } | ||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | ▶ | while ($line_nr < $last_line_nr){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | last unless $self->GetLine( $line_nr + 1 ) =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | $line_nr++; | |||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 0 | $line_nr; | |||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | ▶ | sub prev_sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prev_sub: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 0 | $self->GotoPos( $pos-1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 324 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | $self->SearchPrev( &Wx::wxSTC_FIND_REGEXP, '^\s*sub '); | |||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 0 | ▶ | sub next_sub { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next_sub: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 330 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 0 | $self->GotoPos( $pos+1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 332 | 0 | $self->SearchAnchor; | |||||||||||||||||||||||||||||||||||||||||||||
| 333 | 0 | $self->SearchNext( &Wx::wxSTC_FIND_REGEXP, '^\s*sub '); | |||||||||||||||||||||||||||||||||||||||||||||
| 334 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | ▶ | sub smart_up_pos { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
smart_up_pos: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | my $bpos = $self->prev_brace_pos( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | return $bpos if $bpos != $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | my $line_nr = $self->get_prev_block_start( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | defined $line_nr ? $self->PositionFromLine( $line_nr ) : $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | ▶ | sub smart_down_pos { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
smart_down_pos: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | my $bpos = $self->next_brace_pos( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | ▶ | return $bpos if $bpos != $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 0 | my $line_nr = $self->get_next_block_start( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | ▶ | defined $line_nr ? $self->PositionFromLine( $line_nr ) : $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 0 | ▶ | sub prev_brace_pos { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prev_brace_pos: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 356 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | my $char_before = $self->GetTextRange( $pos-1, $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | my $char_after = $self->GetTextRange( $pos, $pos + 1); | |||||||||||||||||||||||||||||||||||||||||||||
| 359 | 0 | ▶ | if ( $char_before eq ')' or $char_before eq '}' or $char_before eq ']' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
$char_before eq ")" or $char_before eq "}" or $char_before eq "]"
$char_before eq ")" or $char_before eq "}"
MC/DC0%0/3
$char_before eq ")" or $char_before eq "}" or $char_before eq "]"
$char_before eq ")"
$char_before eq "}"
$char_before eq "]"
Truth table0%0/4
A or B or C
A= $char_before eq ")"B= $char_before eq "}"C= $char_before eq "]"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 360 | 0 | my $mpos = $self->BraceMatch( $pos - 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 361 | 0 | ▶ | return $mpos if $mpos != &Wx::wxSTC_INVALID_POSITION; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 362 | ▶ | } elsif ($char_after eq ')' or $char_after eq '}' or $char_after eq ']'){ | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$char_after eq ")" or $char_after eq "}" or $char_after eq "]"
$char_after eq ")" or $char_after eq "}"
MC/DC0%0/3
$char_after eq ")" or $char_after eq "}" or $char_after eq "]"
$char_after eq ")"
$char_after eq "}"
$char_after eq "]"
Truth table0%0/4
A or B or C
A= $char_after eq ")"B= $char_after eq "}"C= $char_after eq "]"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 363 | 0 | my $mpos = $self->BraceMatch( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 364 | 0 | ▶ | return $mpos + 1 if $mpos != &Wx::wxSTC_INVALID_POSITION; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 0 | $pos; | |||||||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 0 | ▶ | sub next_brace_pos { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next_brace_pos: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 0 | my ($self, $pos) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 371 | 0 | ▶ | $pos = $self->GetCurrentPos unless defined $pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 0 | my $char_before = $self->GetTextRange( $pos-1, $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 373 | 0 | my $char_after = $self->GetTextRange( $pos, $pos + 1); | |||||||||||||||||||||||||||||||||||||||||||||
| 374 | 0 | ▶ | if ( $char_before eq '(' or $char_before eq '{' or $char_before eq '[' ) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
$char_before eq "(" or $char_before eq "{" or $char_before eq "["
$char_before eq "(" or $char_before eq "{"
MC/DC0%0/3
$char_before eq "(" or $char_before eq "{" or $char_before eq "["
$char_before eq "("
$char_before eq "{"
$char_before eq "["
Truth table0%0/4
A or B or C
A= $char_before eq "("B= $char_before eq "{"C= $char_before eq "["
| |||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 0 | my $mpos = $self->BraceMatch( $pos - 1 ); | |||||||||||||||||||||||||||||||||||||||||||||
| 376 | 0 | ▶ | return $mpos if $mpos != &Wx::wxSTC_INVALID_POSITION; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 377 | ▶ | } elsif ($char_after eq '(' or $char_after eq '{' or $char_after eq '['){ | |||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$char_after eq "(" or $char_after eq "{" or $char_after eq "["
$char_after eq "(" or $char_after eq "{"
MC/DC0%0/3
$char_after eq "(" or $char_after eq "{" or $char_after eq "["
$char_after eq "("
$char_after eq "{"
$char_after eq "["
Truth table0%0/4
A or B or C
A= $char_after eq "("B= $char_after eq "{"C= $char_after eq "["
| |||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 0 | my $mpos = $self->BraceMatch( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 379 | 0 | ▶ | return $mpos + 1 if $mpos != &Wx::wxSTC_INVALID_POSITION; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 380 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 0 | $pos; | |||||||||||||||||||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 0 | ▶ | sub same_column_in_other_line { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
same_column_in_other_line: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 0 | my ($self, $pos, $lines) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 386 | 0 | ▶ | $lines //= 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$lines //= 0
MC/DC0%0/1
$lines //= 0
$lines
Truth table0%0/2
A
A= $lines
| |||||||||||||||||||||||||||||||||||||||||||||||
| 387 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||||||||||||||||||||
| 389 | 0 | ▶ | sub column_in_prev_lines { # get position at same column as $pos, but $lines up | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
column_in_prev_lines: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 390 | 0 | my ($self, $pos, $lines) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | $lines //= 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$lines //= 1
MC/DC0%0/1
$lines //= 1
$lines
Truth table0%0/2
A
A= $lines
| |||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 0 | my $line_nr = $self->LineFromPosition( $pos ) - $lines; | |||||||||||||||||||||||||||||||||||||||||||||
| 393 | 0 | ▶ | return $pos if $line_nr < 0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 394 | 0 | my ($col) = ($self->get_caret_pos_cache('caret_col')); | |||||||||||||||||||||||||||||||||||||||||||||
| 395 | 0 | ▶ | unless (defined $col){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 0 | $col = $self->GetColumn( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 397 | 0 | $self->set_caret_pos_cache('caret_col', $col); | |||||||||||||||||||||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 399 | 0 | my $next_pos = $self->PositionFromLine( $line_nr ) + $col; | |||||||||||||||||||||||||||||||||||||||||||||
| 400 | 0 | my $line_end = $self->GetLineEndPosition( $line_nr ); | |||||||||||||||||||||||||||||||||||||||||||||
| 401 | 0 | ▶ | return $line_end < $next_pos ? $line_end : $next_pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 0 | ▶ | sub column_in_next_lines { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
column_in_next_lines: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 404 | 0 | my ($self, $pos, $lines) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 405 | 0 | ▶ | $lines //= 1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$lines //= 1
MC/DC0%0/1
$lines //= 1
$lines
Truth table0%0/2
A
A= $lines
| |||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 0 | my $line_nr = $self->LineFromPosition( $pos ) + $lines; | |||||||||||||||||||||||||||||||||||||||||||||
| 407 | 0 | ▶ | return $self->GetLastPosition if $self->GetLineCount <= $line_nr; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 408 | 0 | my ($col) = ($self->get_caret_pos_cache('caret_col')); | |||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | unless (defined $col){ | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 410 | 0 | $col = $self->GetColumn( $pos ); | |||||||||||||||||||||||||||||||||||||||||||||
| 411 | 0 | $self->set_caret_pos_cache('caret_col', $col); | |||||||||||||||||||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 0 | my $next_pos = $self->PositionFromLine( $line_nr) + $col; | |||||||||||||||||||||||||||||||||||||||||||||
| 414 | 0 | my $line_end = $self->GetLineEndPosition( $line_nr); | |||||||||||||||||||||||||||||||||||||||||||||
| 415 | 0 | ▶ | return $line_end < $next_pos ? $line_end : $next_pos; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||