Branch Coverage

File:lib/CheckSpelling/UnknownWordSplitter.pm
Coverage:72.5%

line%coveragebranch
5550TFif $expression =~ /\?\{/u
6750TFdefined $2 ? :
7750TFif (open $fh, "<:utf8", $re)
86100TFif (/^#(?:\s(.+)|)/u)
87100TFif $hint eq "" and defined $1
90100TFunless $_ ne ""
9150TFif $_ eq "\$^"
93100TFunless s/^(.+)/(?:$1)/u
95100TFunless (test_re($quoted))
103100TFif (defined $hints{$_}) { }
13150TFtest_re($quoted) ? :
13350TFunless scalar @list
14550TFunless open my $file_fh, "<:utf8", $re
152100TFif /^#/u
15550TFunless /^./u
161100TFunless ($pairs == $true_pairs)
18250TFif $CheckSpelling::UnknownWordSplitter::shortest_word
183100TFif ($CheckSpelling::UnknownWordSplitter::longest_word) { }
100TFelsif (not_empty($CheckSpelling::UnknownWordSplitter::longest)) { }
192100TFif defined $_
193100TFunless $word_pattern
19450TFif (defined $CheckSpelling::UnknownWordSplitter::shortest and not_empty($CheckSpelling::UnknownWordSplitter::longest) and $CheckSpelling::UnknownWordSplitter::shortest > $CheckSpelling::UnknownWordSplitter::longest)
199100TFunless defined $CheckSpelling::UnknownWordSplitter::shortest
200100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
218100TFif ($CheckSpelling::UnknownWordSplitter::check_homoglyphs and not $CheckSpelling::UnknownWordSplitter::check_homoglyphs =~ /false/iu) { }
22050TFif (-s $homoglyph_list_path) { }
235100TFunless $word =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
237100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
238100TFif $l > $CheckSpelling::UnknownWordSplitter::longest
239100TFif $l < $CheckSpelling::UnknownWordSplitter::shortest
25550TFif (open my $aff_fh, "<", $aff)
2570TFunless /^SET\s+(\S+)/u
2580TFunless $1 =~ /utf-8/iu
280100TFif ($CheckSpelling::UnknownWordSplitter::hunspell_dictionary_path)
28250TFif (eval 'use Text::Hunspell; 1') { }
292100TFif (-e "$configuration/block-delimiters.list")
294100TFif (@block_delimiters)
30950TFif (-e "$configuration/patterns.txt") { }
317100TFif (-e "$configuration/forbidden.txt") { }
326100TFif (-e "$configuration/candidates.txt") { }
32850TF$in_patterns_re_list{$_} || !test_re($quoted) ? :
34650TFif ($CheckSpelling::UnknownWordSplitter::check_images)
3480TFif $CheckSpelling::UnknownWordSplitter::ocr_directory =~ /^(.*)$/u
358100TFunless -e $CheckSpelling::UnknownWordSplitter::base_dict
381100TFunless $token =~ /$pattern/u
387100TFunless $token =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
388100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
393100TFif (@CheckSpelling::UnknownWordSplitter::hunspell_dictionaries)
39750TFdefined $hunspell_dictionary->{'encoding'} ? :
39850TFunless $hunspell_dictionary->{'engine'}->check($token_encoded)
40550TFif $found
408100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
41350TFunless ($CheckSpelling::UnknownWordSplitter::disable_word_collating)
415100TFif length $key >= $shortest_threshold
41750TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
4450TFif (-e $ocr_file and -e $ocr_source_sha and open my $source_sha, "<", $ocr_source_sha)
4500TFif ($last_sha =~ /(.*)/u)
4510TFif $1 eq $sha
4580TFunless defined $text_file
4610TFif ($text_file =~ /^(.*)$/u)
4640TFif ($file_size > 20) { }
492100TFunless $CheckSpelling::UnknownWordSplitter::ignore_next_line_pattern =~ /./u
50550TFif defined $ENV{'DEBUG'}
509100TFif (defined readlink $file and rindex("File::Spec"->abs2rel(abs_path($file)), "../", 0) == 0)
514100TFif ($use_magic_file) { }
50TFelsif ($file =~ /\.(?:png|jpe?g|gif)$/u) { }
51550TFif (open my $file_fh, "-|", "/usr/bin/file", "-b", "--mime", "-e", "cdf", "-e", "compress", "-e", "csv", "-e", "elf", "-e", "json", "-e", "tar", $file)
52950TFif ($CheckSpelling::UnknownWordSplitter::check_images and $file_kind =~ m[^image/(?!svg)]u)
532100TFif ($file_converted == 0 and $file_kind =~ /^(.*?); charset=binary/u)
54250TFif (defined $largest_file)
54350TFunless ($CheckSpelling::UnknownWordSplitter::check_file_names eq $file)
544100TFif ($file_size > $largest_file)
559100TFif ($unix_new_lines == 0 and $mac_new_lines == 0) { }
100TFelsif ($dos_new_lines >= $unix_new_lines and $dos_new_lines >= $mac_new_lines) { }
100TFelsif ($mac_new_lines > $unix_new_lines) { }
590100TFif ($. == 1)
59150TFunless ($disable_minified_file)
592100TFif ($file_size >= 512 and length $_ == $file_size)
60050TFif (/[\x{D800}-\x{DFFF}]/u)
605100TFunless /./u
610100TFif ($CheckSpelling::UnknownWordSplitter::begin_block_re)
613100TFunless /\Q$next_end_marker\E/u
619100TFunless @captured
62150TFif ($captured[$capture])
629100TFif $parsed_block_markers
634100TFif $ignore_this_line
637100TFif (defined $CheckSpelling::UnknownWordSplitter::patterns_re)
643100TFif ($CheckSpelling::UnknownWordSplitter::forbidden_re)
651100TFif ($test_line =~ s/($forbidden_re_singleton)/"=" x length($1);/eu)
65250TFunless $test_line eq $_
65450TFunless $begin == $begin_test
65550TFunless $end == $end_test
65650TFunless $match eq $match_test
660100TFunless $forbidden_re_lines[$i]
665100TFif ($found_trigger_re) { }
669100TFif ($description ne '') { }
68550TFif ($CheckSpelling::UnknownWordSplitter::check_homoglyphs)
69250TFdefined $CheckSpelling::UnknownWordSplitter::longest_word && $CheckSpelling::UnknownWordSplitter::longest_word =~ /^\d+$/u ? :
69850TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
715100TFif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern$CheckSpelling::UnknownWordSplitter::lower_pattern/u) { }
50TFelsif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern/u) { }
72250TF$token =~ /$CheckSpelling::UnknownWordSplitter::upper_pattern$/u ? :
72750TFunless $match =~ /./u
731100TFunless ($found_token)
73250TFif (not $raw_line =~ /$token.*$token/u and $raw_line =~ /($token)/u) { }
743100TFif ($line_flagged and $CheckSpelling::UnknownWordSplitter::candidates_re)
74650TFif ($_ ne $initial_line_state)
750100TFunless $candidate_re =~ /./u and $raw_line =~ /$candidate_re/u
75150TFif ($_ =~ s/($candidate_re)/"=" x length($1);/eu)
75750TFunless $candidates_re_lines[$i]
76350TFunless ($disable_minified_file)
768100TFif ($ratio > $ratio_threshold)
774100TFif ($next_end_marker)
77550TFif ($start_marker_line)
78550TFif ($@)
7860TFunless $@ eq "alarm\n"
795100TFif ($CheckSpelling::UnknownWordSplitter::unrecognized or @candidates_re_hits or @forbidden_re_hits)
797100TF@candidates_re_hits ? :
100TF@candidates_re_lines ? :
100TF@forbidden_re_hits ? :
100TF@forbidden_re_lines ? :
816100TFunless (%CheckSpelling::UnknownWordSplitter::dictionary)