Branch Coverage

File:lib/CheckSpelling/SpellingCollator.pm
Coverage:78.7%

line%coveragebranch
21100TFunless $record =~ /\b$field:\s*(\d+)/u
2750TFunless $record =~ /\b$field: \[([^\]]+)\]/u
3450TFunless $next and $next < $value
44100TFif (defined $CheckSpelling::SpellingCollator::expected{$item}) { }
100TFelsif ($item =~ /^([A-Z])(.*)/u) { }
46100TFif $value < $next
49100TFif (defined $CheckSpelling::SpellingCollator::expected{$item}) { }
54100TFif (defined $CheckSpelling::SpellingCollator::expected{$item})
60100TFunless defined $next
67100TFif expect_item($word, 1)
6950TFif expect_item($key, 2)
70100TFif ($key =~ /.s$/u) { }
100TFelsif ($key =~ /^(.+[^aeiou])ed$/u) { }
100TFelsif ($key =~ /^(.+)'[ds]$/u) { }
71100TFif ($key =~ /ies$/u) { }
8350TFif expect_item($key, 3)
89100TFif ($warning =~ /\(([-\w]+)\)$/u)
9150TFif CheckSpelling::Util::is_ignoring_event($code)
9850TFunless $warning =~ /\(([-\w]+)\)$/u
100100TFif CheckSpelling::Util::is_ignoring_event($code)
10950TFif should_skip_warning($warning)
110100TFif skip_item($item)
113100TFif (defined $seen_count)
114100TFif (not defined $unknown_word_limit or $seen_count++ < $unknown_word_limit) { }
13050TFif $CheckSpelling::SpellingCollator::disable_word_collating
132100TFunless defined $CheckSpelling::SpellingCollator::shortest_word
135100TFif ($key =~ /.s$/u) { }
100TFelsif ($key_length > $CheckSpelling::SpellingCollator::shortest_word + 1 and $key =~ /.[^aeiou]ed$/u) { }
136100TFif ($key_length > $CheckSpelling::SpellingCollator::shortest_word + 1 and $key =~ /ies$/u) { }
100TFelsif ($key_length > $CheckSpelling::SpellingCollator::shortest_word and not $key =~ /ies$/u) { }
151100TFif ($CheckSpelling::SpellingCollator::disable_word_collating) { }
16850TFif (open EXPECT, "<:utf8", $expect)
185100TFunless defined $CheckSpelling::SpellingCollator::letter_map{$char}{$key}
187100TFif defined $word_map{$word}
18950TFif $words > 2
190100TFif ($word eq $key)
19150TFif $words > 1
200100TFif $CheckSpelling::SpellingCollator::disable_word_collating
206100TFif $key eq $plural_key
207100TFunless defined $CheckSpelling::SpellingCollator::letter_map{$char}{$key}
221100TFif ($warning =~ /\(([-\w]+)\)$/u)
223100TFif CheckSpelling::Util::is_ignoring_event($code)
23850TFunless defined $ENV{$path}
24050TFunless open ITEMS, "<:utf8", $1
246100TFif ($pattern =~ /^#/u)
24750TFif ($pattern =~ /^# /u) { }
255100TFunless ($pattern =~ /./u)
268100TFunless @{$totals;}
26950TFunless open my $fh, ">:utf8", $path
272100TFif ($file_counts) { }
2740TFunless $totals->[$b] <=> $totals->[$a]
28350TFunless $totals->[$i] > 0
28650TFif ($rule_with_context =~ /^(.*\n)([^\n]+)$/su) { }
291100TF$file_counts ? :
303100TFif $file eq $special->{'file_list'}
304100TFif $file eq $special->{'pr_title_file'}
305100TFif $file eq $special->{'pr_description_file'}
306100TFunless rindex $file, $special->{'commit_messages'}
34650TFif ($timing_report)
36550TFunless $directory =~ /^(.*)$/u
367100TFunless (-e $directory)
371100TFunless (-d $directory)
377100TFunless open NAME, "<:utf8", "$directory/name"
38650TFif ($timing_report)
390100TFif (-e "$directory/skipped")
39850TFif $timing_report
403100TFunless (-s "$directory/stats")
40450TFif $timing_report
409100TFif ($file eq $file_list)
430100TFif (@candidate_totals)
43350TFif (@candidate_list)
43650TFif ($hits)
43850TFif ($candidate_file_counts[$i]++ < $candidate_example_limit)
44450TFif ($candidates[$i] =~ /^#\s+(\S.+)/u)
453100TFif (@forbidden_totals)
45650TFif (@forbidden_list)
45950TFif ($hits)
46850TFif $timing_report
471100TFif ($unknown > $unique)
47550TFunless ($disable_noisy_file)
47650TFif ($kind eq "file")
487100TFunless ($kind =~ /^file/u and -s "$directory/unknown")
493100TFunless $token =~ /./u
495100TFunless defined $CheckSpelling::SpellingCollator::letter_map{$char}
497100TFif defined $CheckSpelling::SpellingCollator::letter_map{$char}{$key}
50450TFif $timing_report
52350TFif ($context =~ /^(.*?)$(.*)/msu)
52550TFif $details
52750TFunless $context
537100TFif (defined $ENV{'expect'})
547100TFif (-s $early_warnings)
55150TFif should_skip_warning_while_counting($warning)
560100TFunless -s "$directory/warnings"
56150TFunless open NAME, "<:utf8", "$directory/name"
566100TFif ($kind ne 'file-list') { }
570100TFif ($warning =~ /:(\d+):(\d+ \.\.\. \d+): `(.*)`/u) { }
574100TFunless $kind eq "file"
576100TFif log_skip_item($item, $file, $warning, $unknown_word_limit)
57750TFif $kind ne "file"
58050TFif ($warning =~ /\`(.*?)\` in line \(token-is-substring\)/u)
5810TFif skip_item($1)
58550TFif should_skip_warning($warning, $code)
59150TFunless $warning =~ s/^:(\d+)/:1/u
593100TFif ($warning =~ /:(\d+ \.\.\. \d+): `(.*)`/u)
59750TFif skip_item($item)
59850TFif (defined $unknown_file_word_limit)
599100TFif ++$unknown_file_word_count{$item} > $unknown_file_word_limit
602100TFif should_skip_warning_while_counting($warning)
61150TFif should_skip_warning_while_counting($warning)
614100TFif (defined $unknown_word_limit)
61750TFunless $warning_count >= $unknown_word_limit
6200TFif should_skip_warning_while_counting($warning)
626100TFif (%counters)
642100TFif (scalar @words > 1) { }
64350TFunless length $a <=> length $b
658100TFunless /(.*) \((.*)\)/u
668100TFif ($_ =~ /$pattern/u) { }
670100TFif s/not a recognized word/ignored by check-spelling because another more general variant is also in expect/u
671100TFif s/unrecognized-spelling/ignored-expect-variant/u
672100TFunless $print
674100TFunless /\(((?:\w+-)+\w+)\)$/u
675100TFif $1 eq "unrecognized-spelling"