Branch Coverage

blib/lib/Open/This.pm
Criterion Covered Total %
branch 103 120 85.8


line true false branch
31 69 0 if ($text)
36 69 0 if ($text)
40 0 69 unless $text
45 11 58 if $col
51 41 28 if (-e path($text)) { }
1 27 elsif (my $file_name = _maybe_git_diff_path($text)) { }
2 25 elsif ($text =~ m[^[^/]+\.go$]) { }
59 1 1 if $file_name
62 26 43 unless (exists $parsed{'file_name'})
63 1 25 if (my $bin = _which($text))
71 4 65 if (not $parsed{'file_name'} and $text =~ m[\Ahttps?://]i)
75 15 6 if (not $parsed{'file_name'} and $parsed{'is_module_name'})
81 4 6 if (not $parsed{'file_name'} and $parsed{'is_module_name'})
83 2 2 if ($found)
88 30 39 unless ($parsed{'line_number'})
96 259 91 if defined $parsed{$_}
98 61 8 $return{'file_name'} ? :
110 0 0 if ($err)
116 0 0 unless $parsed and $parsed->{'file_name'}
119 0 0 unless $url and $url->can("host")
130 0 0 if ($parsed->{'line_number'})
144 1 44 unless $parsed
146 1 43 unless $ENV{'EDITOR'}
152 23 20 if ($ENV{'EDITOR'} eq 'kate' or $ENV{'EDITOR'} =~ /^(idea|rubymine|pycharm|phpstorm|webstorm|goland|rider|clion|fleet|aqua|data(grip|spell)|appcode)/i) { }
6 14 elsif ($ENV{'EDITOR'} =~ /^cod(e|ium)/i) { }
2 12 elsif (exists $parsed->{'column_number'}) { }
157 18 5 if $parsed->{'line_number'}
160 5 18 if $parsed->{'column_number'}
167 4 2 if ($parsed->{'line_number'})
169 2 2 if ($parsed->{'column_number'})
181 1 1 if ($ENV{'EDITOR'} eq "nvim" or $ENV{'EDITOR'} eq "vi" or $ENV{'EDITOR'} eq "vim")
192 1 1 if ($ENV{'EDITOR'} eq "nano")
208 7 5 if $parsed->{'line_number'}
218 4 76 if ($$text =~ s/ line (\d+).*, column (\d+).*//)
225 15 61 if ($$text =~ s/ line (\d+).*//)
231 1 60 if ($$text =~ s/ (\w) : \[ (\d+) , (\d+) \] /$1/x)
237 11 49 if ($$text =~ s/(\w):(\d+):(\d+).*/$1/)
243 12 37 if ($$text =~ s/(\w):(\d+)\b/$1/)
250 5 32 if ($$text =~ s/(\w)#L(\d+)\b.*/$1/)
256 2 30 if ($$text =~ s/(\w)-(\d+)\-{0,1}\z/$1/)
267 4 65 if ($$text =~ /'(.*)'/)
269 4 0 if -e $maybe_file
276 9 64 if ($$text =~ s/::(\w+)\(.*\)//)
286 5 18 if ($file_name and $sub_name and open my $fh, "<", $file_name)
289 5 16 if ($line =~ /sub $sub_name\b/)
306 4 0 if ($parts[3] eq "blob")
309 0 4 unless $file->is_file
313 0 4 if ($uri->fragment and $uri->fragment =~ /\A[\d]\z/)
316 4 0 if $file
326 2 15 exists $ENV{'OPEN_THIS_LIBS'} ? :
330 13 12 if ($path->is_file)
340 3 25 if ($file_name =~ m[^[ab]/(.+)$])
341 1 2 if (-e path($1))
353 0 29 unless $maybe_file
359 9 20 if $dir
364 2 150 if $abs->is_file
378 87 193 unless $path->is_file
379 1 192 if $path->basename eq $text
381 1 192 if --$threshold == 0
383 1 2 if ($threshold == 0 and not $file_name)