Branch Coverage

blib/lib/Text/Record/Deduper.pm
Criterion Covered Total %
branch 64 114 56.1


line true false branch
356 1 0 if $field_separator eq '|'
373 2 2 if ($args{'field_number'}) { }
2 0 elsif ($args{'start_pos'}) { }
375 0 2 unless ($$deduper{'field_separator'})
383 0 2 if ($$deduper{'field_separator'}) { }
390 0 2 unless ($args{'key_length'})
400 4 11 if ($current_key eq 'ignore_case')
404 3 12 if ($current_key eq 'ignore_whitespace')
408 2 13 if ($current_key eq 'alias')
410 2 0 if ($args{'ignore_case'}) { }
427 6 9 if ($current_key =~ /field_number|start_pos|key_length/)
442 0 0 unless (-T $input_file_name and -s $input_file_name)
449 0 0 unless ($input_fh)
461 0 0 unless ($unique_fh)
468 0 0 unless ($dupes_fh)
508 0 0 unless (-T $input_file_name and -s $input_file_name)
515 0 0 unless ($input_fh)
524 0 0 if ($report_options{'file_name'}) { }
552 0 0 if ($report_options{'file_name'}) { }
575 0 0 unless ($report_fh)
593 0 0 if ($report_options{'all_records'} or $$master_record_index_ref{$record_num}{'type'} ne 'unique' and $$master_record_index_ref{$record_num}{'parent'} > 0)
598 0 0 if ($$master_record_index_ref{$record_num}{'parent'})
627 3 0 if ($$deduper{'alias'})
635 2 14 if ($alias_candidate_key and not $alias_candidates{$alias_candidate_key})
651 0 3 if ($storage_type eq 'file' and $$deduper{'alias'})
669 4 12 if ($parent_record_number = $deduper->_alias_dupe(\%alias_candidates, %record_keys)) { }
5 7 elsif ($parent_record_number = _exact_dupe($current_line, $full_key, %seen_exact_dupes)) { }
707 16 4 if ($$deduper{'alias'}{$current_key}) { }
709 0 16 unless $all_alias_values{$current_key}
710 4 12 if (grep /^$current_key_data$/, @{$all_alias_values{$current_key};}) { }
740 6 3 unless ($seen_alias_values{$current_alias_value})
763 32 0 if ($$deduper{'key'}) { }
765 12 20 if ($$deduper{'field_separator'}) { }
772 4 8 if ($current_line =~ /\w'\w/)
786 0 24 unless ($current_field_data)
798 0 24 if ($$deduper{'key'}{$key_number}{'key_length'})
811 40 0 if ($current_field_data) { }
841 32 0 if ($$deduper{'ignore_whitespace'})
851 32 0 if ($$deduper{'ignore_case'})
889 16 0 if ($$deduper{'alias'})
898 8 31 if ($record_keys{$key_number} eq $current_alias_key)
906 8 8 if ($alias_was_substituted)
913 4 4 if ($$alias_candidates_ref{$full_key})
930 5 7 if ($seen_exact_dupes{$full_key}) { }
950 0 48 if ($storage_type eq 'file') { }
48 0 elsif ($storage_type eq 'array') { }
952 0 0 if ($current_line = $input_fh->getline) { }
955 0 0 if ($input_fh->eof)
970 9 39 if ($current_record_number == $last_element) { }
0 39 elsif ($current_record_number > $last_element) { }
1004 9 7 if ($parent_record_number)
1019 0 3 if ($storage_type eq 'file')
1044 7 9 if ($parent_record_number == 0)
1061 0 16 if ($storage_type eq 'file') { }
16 0 elsif ($storage_type eq 'array') { }
1064 0 0 if ($dupe_type eq 'unique') { }
1075 7 9 if ($dupe_type eq 'unique') { }