Branch Coverage

lib/Rex/Commands/Iptables.pm
Criterion Covered Total %
branch 8 86 9.3


line true false branch
135 0 0 if (ref $option ne "HASH")
138 0 0 if (exists $option_h{'only_if'})
140 0 0 if ($? != 0)
173 0 0 if (ref $option ne "HASH")
176 0 0 if (exists $option_h{'only_if'})
178 0 0 if ($? != 0)
208 0 0 if ($ip_version == -6)
210 0 0 if ($iptables_version < v1.4.18)
221 0 0 unless (ref $option)
238 0 0 unless (exists $option->{'dev'})
250 0 0 if ($option->{'to'} =~ /^\d+$/u) { }
311 0 0 if ($params[0] eq "flush" or $params[0] eq "-flush" or $params[0] eq "-F")
312 0 0 if ($params[1]) { }
327 0 0 if (ref $key eq "ARRAY")
332 0 0 if (length $key == 1) { }
342 0 0 if ($? != 0)
365 0 0 if (my $ip = can_run('ip')) { }
373 0 0 if ($ip_version == -6) { }
374 0 0 if _iptables_version($ip_version) < v1.4.18
412 0 0 unless (exists $option{'dev'})
458 1 9 if $line eq "COMMIT"
459 1 8 if $line =~ /^#/u
460 4 4 if $line =~ /^:/u
462 2 2 if ($line =~ /^\*([a-z]+)$/u)
504 0 0 if (is_file("$tables_of{$ip_version}"))
525 0 0 unless (exists $option->{'dev'})
531 0 0 if (exists $option->{'dev'} and not ref $option->{'dev'}) { }
0 0 elsif (ref $option->{'dev'} eq 'ARRAY') { }
546 0 0 if (exists $option->{'proto'}) { }
555 0 0 if ($port eq 'all') { }
559 0 0 if (ref $port eq "ARRAY")
571 0 0 if (_rule_exists($ip_version, @opts))
583 0 0 if ($check_rule[0] eq "t")
588 0 0 if ($check_rule[0] eq "D" or $check_rule[0] eq "A")
595 0 0 if (exists $current_tables->{'filter'})
601 0 0 if ($str_rule eq $str_check_rule)
612 0 0 if (defined $params->[0] and not ref $params->[0])
613 0 0 if ($params->[0] eq -4 or $params->[0] eq -6)
625 0 0 if $cache->valid($cache_key_name)
627 0 0 $ip_version == -6 ? :
629 0 0 if $executable eq ""
640 0 0 if $cache->valid($cache_key_name)
645 0 0 if ($out =~ /v([.\d]+)/msu) { }