Branch Coverage

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

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 $CheckSpelling::UnknownWordSplitter::check_homoglyphs ne 'false') { }
22050TFif (-s $homoglyph_list_path)
233100TFunless $word =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
235100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
236100TFif $l > $CheckSpelling::UnknownWordSplitter::longest
237100TFif $l < $CheckSpelling::UnknownWordSplitter::shortest
25350TFif (open my $aff_fh, "<", $aff)
2550TFunless /^SET\s+(\S+)/u
2560TFunless $1 =~ /utf-8/iu
278100TFif ($CheckSpelling::UnknownWordSplitter::hunspell_dictionary_path)
28050TFif (eval 'use Text::Hunspell; 1') { }
290100TFif (-e "$configuration/block-delimiters.list")
292100TFif (@block_delimiters)
30750TFif (-e "$configuration/patterns.txt") { }
315100TFif (-e "$configuration/forbidden.txt") { }
324100TFif (-e "$configuration/candidates.txt") { }
32650TF$in_patterns_re_list{$_} || !test_re($quoted) ? :
34450TFif ($CheckSpelling::UnknownWordSplitter::check_images)
3460TFif $CheckSpelling::UnknownWordSplitter::ocr_directory =~ /^(.*)$/u
356100TFunless -e $CheckSpelling::UnknownWordSplitter::base_dict
379100TFunless $token =~ /$pattern/u
385100TFunless $token =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
386100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
391100TFif (@CheckSpelling::UnknownWordSplitter::hunspell_dictionaries)
39550TFdefined $hunspell_dictionary->{'encoding'} ? :
39650TFunless $hunspell_dictionary->{'engine'}->check($token_encoded)
40350TFif $found
406100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
41150TFunless ($CheckSpelling::UnknownWordSplitter::disable_word_collating)
413100TFunless length $key >= $shortest_threshold
41550TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
4430TFif (-e $ocr_file and -e $ocr_source_sha and open my $source_sha, "<", $ocr_source_sha)
4480TFif ($last_sha =~ /(.*)/u)
4490TFif $1 eq $sha
4560TFunless defined $text_file
4590TFif ($text_file =~ /^(.*)$/u)
4620TFif ($file_size > 20) { }
490100TFunless $CheckSpelling::UnknownWordSplitter::ignore_next_line_pattern =~ /./u
50350TFif defined $ENV{'DEBUG'}
507100TFif (defined readlink $file and rindex("File::Spec"->abs2rel(abs_path($file)), "../", 0) == 0)
512100TFif ($use_magic_file) { }
50TFelsif ($file =~ /\.(?:png|jpe?g|gif)$/u) { }
51350TFif (open my $file_fh, "-|", "/usr/bin/file", "-b", "--mime", "-e", "cdf", "-e", "compress", "-e", "csv", "-e", "elf", "-e", "json", "-e", "tar", $file)
52750TFif ($CheckSpelling::UnknownWordSplitter::check_images and $file_kind =~ m[^image/]u)
530100TFif ($file_converted == 0 and $file_kind =~ /^(.*?); charset=binary/u)
54050TFif (defined $largest_file)
54150TFunless ($CheckSpelling::UnknownWordSplitter::check_file_names eq $file)
542100TFif ($file_size > $largest_file)
557100TFif ($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) { }
588100TFif ($. == 1)
58950TFunless ($disable_minified_file)
590100TFif ($file_size >= 512 and length $_ == $file_size)
59750TFif (/[\x{D800}-\x{DFFF}]/u)
602100TFif $. == 1
603100TFunless /./u
608100TFif ($CheckSpelling::UnknownWordSplitter::begin_block_re)
611100TFunless /\Q$next_end_marker\E/u
617100TFunless @captured
61950TFif ($captured[$capture])
627100TFif $parsed_block_markers
632100TFif $ignore_this_line
635100TFif (defined $CheckSpelling::UnknownWordSplitter::patterns_re)
641100TFif ($CheckSpelling::UnknownWordSplitter::forbidden_re)
649100TFif ($test_line =~ s/($forbidden_re_singleton)/"=" x length($1);/eu)
65050TFunless $test_line eq $_
65250TFunless $begin == $begin_test
65350TFunless $end == $end_test
65450TFunless $match eq $match_test
658100TFunless $forbidden_re_lines[$i]
663100TFif ($found_trigger_re) { }
667100TFif ($description ne '') { }
68350TFif ($CheckSpelling::UnknownWordSplitter::check_homoglyphs)
69050TFdefined $CheckSpelling::UnknownWordSplitter::longest_word && $CheckSpelling::UnknownWordSplitter::longest_word =~ /^\d+$/u ? :
69650TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
713100TFif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern$CheckSpelling::UnknownWordSplitter::lower_pattern/u) { }
50TFelsif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern/u) { }
72050TF$token =~ /$CheckSpelling::UnknownWordSplitter::upper_pattern$/u ? :
72550TFunless $match =~ /./u
729100TFunless ($found_token)
73050TFif (not $raw_line =~ /$token.*$token/u and $raw_line =~ /($token)/u) { }
741100TFif ($line_flagged and $CheckSpelling::UnknownWordSplitter::candidates_re)
74450TFif ($_ ne $initial_line_state)
748100TFunless $candidate_re =~ /./u and $raw_line =~ /$candidate_re/u
74950TFif ($_ =~ s/($candidate_re)/"=" x length($1);/eu)
75550TFunless $candidates_re_lines[$i]
76150TFunless ($disable_minified_file)
766100TFif ($ratio > $ratio_threshold)
772100TFif ($next_end_marker)
77350TFif ($start_marker_line)
78350TFif ($@)
7840TFunless $@ eq "alarm\n"
793100TFif ($CheckSpelling::UnknownWordSplitter::unrecognized or @candidates_re_hits or @forbidden_re_hits)
795100TF@candidates_re_hits ? :
100TF@candidates_re_lines ? :
100TF@forbidden_re_hits ? :
100TF@forbidden_re_lines ? :
814100TFunless (%CheckSpelling::UnknownWordSplitter::dictionary)