Branch Coverage

blib/lib/Open/This.pm
Criterion Covered Total %
branch 101 118 85.5


line true false branch
31 60 0 if ($text)
36 60 0 if ($text)
40 0 60 unless $text
45 11 49 if $col
51 41 19 if (-e path($text)) { }
1 18 elsif (my $file_name = _maybe_git_diff_path($text)) { }
2 16 elsif ($text =~ m[^[^/]+\.go$]) { }
59 1 1 if $file_name
62 17 43 unless (exists $parsed{'file_name'})
63 1 16 if (my $bin = _which($text))
71 4 56 if (not $parsed{'file_name'} and $text =~ m[\Ahttps?://]i)
75 7 5 if (not $parsed{'file_name'} and $parsed{'is_module_name'})
81 4 5 if (not $parsed{'file_name'} and $parsed{'is_module_name'})
83 2 2 if ($found)
88 29 31 unless ($parsed{'line_number'})
96 225 81 if defined $parsed{$_}
98 53 7 $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 35 unless $parsed
150 15 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'}) { }
155 10 5 if $parsed->{'line_number'}
158 5 10 if $parsed->{'column_number'}
165 4 2 if ($parsed->{'line_number'})
167 2 2 if ($parsed->{'column_number'})
179 1 1 if ($ENV{'EDITOR'} eq "nvim" or $ENV{'EDITOR'} eq "vi" or $ENV{'EDITOR'} eq "vim")
190 1 1 if ($ENV{'EDITOR'} eq "nano")
206 7 5 if $parsed->{'line_number'}
216 4 67 if ($$text =~ s/ line (\d+).*, column (\d+).*//)
223 7 60 if ($$text =~ s/ line (\d+).*//)
229 1 59 if ($$text =~ s/ (\w) : \[ (\d+) , (\d+) \] /$1/x)
235 11 48 if ($$text =~ s/(\w):(\d+):(\d+).*/$1/)
241 12 36 if ($$text =~ s/(\w):(\d+)\b/$1/)
248 5 31 if ($$text =~ s/(\w)#L(\d+)\b.*/$1/)
254 2 29 if ($$text =~ s/(\w)-(\d+)\-{0,1}\z/$1/)
265 4 56 if ($$text =~ /'(.*)'/)
267 4 0 if -e $maybe_file
274 9 55 if ($$text =~ s/::(\w+)\(.*\)//)
284 5 18 if ($file_name and $sub_name and open my $fh, "<", $file_name)
287 5 16 if ($line =~ /sub $sub_name\b/)
304 4 0 if ($parts[3] eq "blob")
307 0 4 unless $file->is_file
311 0 4 if ($uri->fragment and $uri->fragment =~ /\A[\d]\z/)
314 4 0 if $file
324 2 7 exists $ENV{'OPEN_THIS_LIBS'} ? :
328 5 12 if ($path->is_file)
338 3 16 if ($file_name =~ m[^[ab]/(.+)$])
339 1 2 if (-e path($1))
351 0 20 unless $maybe_file
357 9 11 if $dir
362 2 69 if $abs->is_file
376 85 189 unless $path->is_file
377 1 188 if $path->basename eq $text
379 1 188 if --$threshold == 0
381 1 2 if ($threshold == 0 and not $file_name)