Branch Coverage

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

line%coveragebranch
5450TFif $expression =~ /\?\{/u
6650TFdefined $2 ? :
7650TFif (open $fh, "<:utf8", $re)
85100TFif (/^#(?:\s(.+)|)/u)
86100TFif $hint eq "" and defined $1
89100TFunless $_ ne ""
9050TFif $_ eq "\$^"
92100TFunless s/^(.+)/(?:$1)/u
94100TFunless (test_re($quoted))
102100TFif (defined $hints{$_}) { }
13050TFtest_re($quoted) ? :
13250TFunless scalar @list
14450TFunless open FILE, "<:utf8", $re
151100TFif /^#/u
15450TFunless /^./u
160100TFunless ($pairs == $true_pairs)
18150TFif $CheckSpelling::UnknownWordSplitter::shortest_word
182100TFif ($CheckSpelling::UnknownWordSplitter::longest_word) { }
100TFelsif (not_empty($CheckSpelling::UnknownWordSplitter::longest)) { }
191100TFif defined $_
192100TFunless $word_pattern
19350TFif (defined $CheckSpelling::UnknownWordSplitter::shortest and not_empty($CheckSpelling::UnknownWordSplitter::longest) and $CheckSpelling::UnknownWordSplitter::shortest > $CheckSpelling::UnknownWordSplitter::longest)
198100TFunless defined $CheckSpelling::UnknownWordSplitter::shortest
199100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
222100TFunless $word =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
224100TFunless not_empty($CheckSpelling::UnknownWordSplitter::longest)
225100TFif $l > $CheckSpelling::UnknownWordSplitter::longest
226100TFif $l < $CheckSpelling::UnknownWordSplitter::shortest
24250TFif (open AFF, "<", $aff)
2440TFunless /^SET\s+(\S+)/u
2450TFunless $1 =~ /utf-8/iu
267100TFif ($CheckSpelling::UnknownWordSplitter::hunspell_dictionary_path)
26950TFif (eval 'use Text::Hunspell; 1') { }
279100TFif (-e "$configuration/block-delimiters.list")
281100TFif (@block_delimiters)
29650TFif (-e "$configuration/patterns.txt") { }
304100TFif (-e "$configuration/forbidden.txt") { }
313100TFif (-e "$configuration/candidates.txt") { }
31550TF$in_patterns_re_list{$_} || !test_re($quoted) ? :
33350TFif ($CheckSpelling::UnknownWordSplitter::check_images)
3350TFif $CheckSpelling::UnknownWordSplitter::ocr_directory =~ /^(.*)$/u
345100TFunless -e $CheckSpelling::UnknownWordSplitter::base_dict
368100TFunless $token =~ /$pattern/u
374100TFunless $token =~ /$CheckSpelling::UnknownWordSplitter::word_match/u
375100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$token})
380100TFif (@CheckSpelling::UnknownWordSplitter::hunspell_dictionaries)
38450TFdefined $hunspell_dictionary->{'encoding'} ? :
38550TFunless $hunspell_dictionary->{'engine'}->check($token_encoded)
39250TFif $found
395100TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
40050TFunless ($CheckSpelling::UnknownWordSplitter::disable_word_collating)
402100TFunless length $key >= $shortest_threshold
40450TFif (defined $CheckSpelling::UnknownWordSplitter::dictionary{$key})
4320TFif (-e $ocr_file and -e $ocr_source_sha and open my $source_sha, "<", $ocr_source_sha)
4370TFif ($last_sha =~ /(.*)/u)
4380TFif $1 eq $sha
4450TFunless defined $text_file
4480TFif ($text_file =~ /^(.*)$/u)
4510TFif ($file_size > 20) { }
479100TFunless $CheckSpelling::UnknownWordSplitter::ignore_next_line_pattern =~ /./u
49250TFif defined $ENV{'DEBUG'}
496100TFif (defined readlink $file and rindex("File::Spec"->abs2rel(abs_path($file)), "../", 0) == 0)
501100TFif ($use_magic_file) { }
50TFelsif ($file =~ /\.(?:png|jpe?g|gif)$/u) { }
50250TFif (open my $file_fh, "-|", "/usr/bin/file", "-b", "--mime", "-e", "cdf", "-e", "compress", "-e", "csv", "-e", "elf", "-e", "json", "-e", "tar", $file)
51650TFif ($CheckSpelling::UnknownWordSplitter::check_images and $file_kind =~ m[^image/]u)
519100TFif ($file_converted == 0 and $file_kind =~ /^(.*?); charset=binary/u)
52950TFif (defined $largest_file)
53050TFunless ($CheckSpelling::UnknownWordSplitter::check_file_names eq $file)
531100TFif ($file_size > $largest_file)
546100TFif ($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) { }
577100TFif ($. == 1)
57850TFunless ($disable_minified_file)
579100TFif ($file_size >= 512 and length $_ == $file_size)
58650TFif (/[\x{D800}-\x{DFFF}]/u)
591100TFif $. == 1
592100TFunless /./u
597100TFif ($CheckSpelling::UnknownWordSplitter::begin_block_re)
600100TFunless /\Q$next_end_marker\E/u
606100TFunless @captured
60850TFif ($captured[$capture])
616100TFif $parsed_block_markers
621100TFif $ignore_this_line
624100TFif (defined $CheckSpelling::UnknownWordSplitter::patterns_re)
630100TFif ($CheckSpelling::UnknownWordSplitter::forbidden_re)
638100TFif ($test_line =~ s/($forbidden_re_singleton)/"=" x length($1);/eu)
63950TFunless $test_line eq $_
64150TFunless $begin == $begin_test
64250TFunless $end == $end_test
64350TFunless $match eq $match_test
647100TFunless $forbidden_re_lines[$i]
652100TFif ($found_trigger_re) { }
656100TFif ($description ne '') { }
680100TFif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern$CheckSpelling::UnknownWordSplitter::lower_pattern/u) { }
50TFelsif ($token =~ /^$CheckSpelling::UnknownWordSplitter::upper_pattern/u) { }
68750TF$token =~ /$CheckSpelling::UnknownWordSplitter::upper_pattern$/u ? :
69250TFunless $match =~ /./u
696100TFunless ($found_token)
69750TFif (not $raw_line =~ /$token.*$token/u and $raw_line =~ /($token)/u) { }
708100TFif ($line_flagged and $CheckSpelling::UnknownWordSplitter::candidates_re)
71150TFif ($_ ne $initial_line_state)
715100TFunless $candidate_re =~ /./u and $raw_line =~ /$candidate_re/u
71650TFif ($_ =~ s/($candidate_re)/"=" x length($1);/eu)
72250TFunless $candidates_re_lines[$i]
72850TFunless ($disable_minified_file)
733100TFif ($ratio > $ratio_threshold)
739100TFif ($next_end_marker)
74050TFif ($start_marker_line)
75050TFif ($@)
7510TFunless $@ eq "alarm\n"
760100TFif ($CheckSpelling::UnknownWordSplitter::unrecognized or @candidates_re_hits or @forbidden_re_hits)
762100TF@candidates_re_hits ? :
100TF@candidates_re_lines ? :
100TF@forbidden_re_hits ? :
100TF@forbidden_re_lines ? :
781100TFunless (%CheckSpelling::UnknownWordSplitter::dictionary)