Branch Coverage

blib/lib/Redis/RdbParser.pm
Criterion Covered Total %
branch 124 206 60.1


line true false branch
107 0 18 unless (defined $filename)
113 0 18 unless open my $INFH, $filename
117 0 18 unless read $INFH, $buffer, 5
120 0 18 unless read $INFH, $buffer, 4
132 1 152 if ($data_type == 252) { }
0 152 elsif ($data_type == 253) { }
140 18 135 if ($data_type == 254)
141 1 17 unless ($is_first_database)
151 18 117 if ($data_type == 255)
152 17 1 unless ($is_first_database)
159 105 12 if (defined $filter) { }
160 105 0 if (&match_db($filter, $db_number)) { }
164 8 97 if (match_filter($filter, $key, $data_type)) { }
180 0 18 unless close $INFH
185 18 87 unless defined $$filter{'dbs'}
186 87 0 if (&in_array($db_number, @{$$filter{'dbs'};}))
197 104 1 if (defined $$filter{'keys'}) { }
199 7 97 if ($key =~ /$_/)
208 87 18 if (defined $$filter{'types'}) { }
210 25 62 if ($DATA_TYPE_MAPPING{$data_type} eq $_)
225 87 0 if ($needle == $_)
237 2748 0 if (defined $$self{'callback'}{$method})
246 0 18 if ($magic ne 'REDIS')
256 0 18 if ($version < 1 or $version > 6)
265 0 4 unless read $fh, $buffer, 1
278 0 4494 unless read $fh, $buffer, 1
291 0 2 unless read $fh, $buffer, 2
304 0 0 unless read $fh, $buffer, 2
317 0 6 unless read $fh, $buffer, 4
330 0 0 unless read $fh, $buffer, 4
343 0 0 unless read $fh, $buffer, 4
356 0 0 unless read $fh, $buffer, 3
371 0 0 unless read $fh, $buffer, 8
384 0 1 unless read $fh, $buffer, 8
397 117 0 if ($free > 0)
422 47 3775 if ($enc_type == 3) { }
3757 18 elsif ($enc_type == 0) { }
18 0 elsif ($enc_type == 1) { }
445 16 3623 if ($is_encoded) { }
446 4 12 if ($length == 0) { }
2 10 elsif ($length == 1) { }
6 4 elsif ($length == 2) { }
4 0 elsif ($length == 3) { }
473 9 11 if ($enc_type == 0) { }
1 10 elsif ($enc_type == 1) { }
1 9 elsif ($enc_type == 2) { }
1 8 elsif ($enc_type == 3) { }
1 7 elsif ($enc_type == 4) { }
0 7 elsif ($enc_type == 9) { }
2 5 elsif ($enc_type == 10) { }
3 2 elsif ($enc_type == 11) { }
1 1 elsif ($enc_type == 12) { }
1 0 elsif ($enc_type == 13) { }
566 3 6 if ($encode == 8) { }
3 3 elsif ($encode == 4) { }
3 0 elsif ($encode == 2) { }
585 0 19 if ($prev_length == 254)
591 11 8 if ($entry_header >> 6 == 0) { }
0 8 elsif ($entry_header >> 6 == 1) { }
0 8 elsif ($entry_header >> 6 == 2) { }
1 7 elsif ($entry_header >> 4 == 12) { }
4 3 elsif ($entry_header >> 4 == 13) { }
3 0 elsif ($entry_header >> 4 == 14) { }
0 0 elsif ($entry_header == 240) { }
0 0 elsif ($entry_header == 254) { }
0 0 elsif ($entry_header >= 241 and $entry_header <= 253) { }
628 0 0 if ($prev_length == 254)
633 0 0 if ($entry_header >> 6 == 0) { }
0 0 elsif ($entry_header >> 6 == 1) { }
0 0 elsif ($entry_header >> 6 == 2) { }
0 0 elsif ($entry_header >> 4 == 12) { }
0 0 elsif ($entry_header >> 4 == 13) { }
0 0 elsif ($entry_header >> 4 == 14) { }
0 0 elsif ($entry_header == 240) { }
0 0 elsif ($entry_header == 254) { }
0 0 elsif ($entry_header >= 241 and $entry_header <= 253) { }
679 0 2 if ($zlist_end != 255)
695 0 1 if ($num_entries % 2)
710 0 1 if ($zlist_end != 255)
727 0 1 if ($num_entries % 2)
743 0 1 if ($zlist_end != 255)
754 0 0 if ($length < 254) { }
0 0 elsif ($length == 254) { }
776 0 0 unless defined $next_length
781 0 0 unless (defined $next_length)
803 31 86 if ($is_encoded) { }
804 6 25 if ($length == 0) { }
6 19 elsif ($length == 1) { }
6 13 elsif ($length == 2) { }
13 0 elsif ($length == 3) { }
828 49 48 if ($enc_type == 0) { }
2 46 elsif ($enc_type == 1) { }
6 40 elsif ($enc_type == 2) { }
0 40 elsif ($enc_type == 3) { }
2 38 elsif ($enc_type == 4) { }
4 34 elsif ($enc_type == 9) { }
20 14 elsif ($enc_type == 10) { }
6 8 elsif ($enc_type == 11) { }
8 0 elsif ($enc_type == 12) { }
0 0 elsif ($enc_type == 13) { }
877 20 15 if ($ctrl < 32) { }
886 4 11 if ($length == 7)
903 0 4 if ($out_index != $expected_length)