Condition Coverage

blib/lib/Algorithm/Classifier/IsolationForest.pm
Criterion Covered Total %
condition 214 295 72.5


and 3 conditions

line !l l&&!r l&&r condition
2784 56 1 62 $args{'use_c'} && $HAS_C
2788 1 2 2 $args{'use_openmp'} && $HAS_OPENMP
2795 0 0 9 $args{'use_openmp_fit'} && $HAS_OPENMP && $use_c
2829 398 18 1 defined $self->{$doc} and ref $self->{$doc}
2843 1 0 7 ref $self->{'feature_names'} eq "ARRAY" and @{$self->{'feature_names'};}
2852 193 5 1 defined $self->{'extension_level'} and $self->{'extension_level'} < 0
2855 2 1 16 $self->{'contamination'} > 0 && $self->{'contamination'} <= 0.5
179 16 3 defined $self->{'contamination'} and not $self->{'contamination'} > 0 && $self->{'contamination'} <= 0.5
2858 184 11 0 defined $self->{'parallel_fit'} and !($self->{'parallel_fit'} =~ /^\d+$/) || $self->{'parallel_fit'} < 1
2901 0 1 8 defined $voting and $voting =~ /\A(?:mean|majority)\z/
2911 0 1 6 ref $self->{'trees'} eq 'ARRAY' && @{$self->{'trees'};}
2912 1 2 4 $fitted && defined $self->{'contamination'}
2914 1 0 3 ref $data eq "ARRAY" and @$data
3026 4 2 166 ref $data eq "ARRAY" and @$data
3029 2 2 162 ref $data->[0] eq "ARRAY" and @{$data->[0];}
3074 147 1 8 defined $workers and $workers > 1
148 0 8 defined $workers and $workers > 1 and $self->{'n_trees'} > 1
1 0 8 defined $workers and $workers > 1 and $self->{'n_trees'} > 1 and _fork_supported()
49 99 0 $self->{'_use_c'} and $self->{'_use_openmp_fit'}
3144 0 0 4 ref $data eq "ARRAY" and @$data
3200 1 0 109 $self->{'_use_c'} and $self->{'_c_nodes'}
3270 2 0 16 $self->{'_use_c'} and $self->{'_c_nodes'}
3303 14 0 255 $self->{'_use_c'} and $self->{'_c_nodes'}
0 0 255 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0
0 1 254 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0
1 2 252 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0 and $threshold < 1
3397 5 0 57 defined $self->{'feature_names'} and ref $self->{'feature_names'} eq "ARRAY"
5 0 57 defined $self->{'feature_names'} and ref $self->{'feature_names'} eq "ARRAY" and @{$self->{'feature_names'};}
3495 2 0 7 $self->{'_use_c'} and $self->{'_c_nodes'}
3516 55 7 326 $self->{'_use_c'} and $self->{'_c_nodes'}
3618 0 0 3 $self->{'_use_c'} and $self->{'_c_nodes'}
3640 2 0 137 $self->{'_use_c'} and $self->{'_c_nodes'}
0 0 137 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0
0 0 137 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0
0 0 137 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0 and $threshold < 1
3741 2 0 4 $self->{'_use_c'} and $self->{'_c_nodes'}
3766 2 0 227 $self->{'_use_c'} and $self->{'_c_nodes'}
0 0 227 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0
0 0 227 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0
0 0 227 $self->{'_use_c'} and $self->{'_c_nodes'} and $self->{'c_psi'} > 0 and $threshold > 0 and $threshold < 1
3916 1 1 53 ref $payload eq "HASH" and defined $payload->{'format'}
4136 0 0 51 defined $proto->{'format'} and not ref $proto->{'format'}
0 1 50 defined $proto->{'format'} and not ref $proto->{'format'} and $proto->{'format'} eq "Algorithm::Classifier::IsolationForest::Prototype"
4139 0 0 50 not ref $version and $version =~ /^\d+$/
0 49 1 not ref $version and $version =~ /^\d+$/ and $version > 1
4148 1 0 47 defined $which and not ref $which
1 1 46 defined $which and not ref $which and $which =~ /\A(?:batch|online)\z/
4153 3 0 86 defined $proto->{$req} and not ref $proto->{$req}
3 1 85 defined $proto->{$req} and not ref $proto->{$req} and length $proto->{$req}
4164 1 1 37 ref $tags eq "ARRAY" and @$tags
4167 0 1 79 defined $t and not ref $t
1 0 79 defined $t and not ref $t and length $t
4173 29 5 1 defined $schema->{'mungers'} and ref $schema->{'mungers'} ne "HASH"
4176 47 21 0 defined $schema->{$str} and ref $schema->{$str}
4180 0 33 1 defined $params and ref $params ne "HASH"
4288 1 0 3 ref $self->{'feature_names'} eq "ARRAY" and @{$self->{'feature_names'};}
4295 2 0 1 ref $self->{'feature_descriptions'} eq "HASH" and %{$self->{'feature_descriptions'};}
4297 3 0 0 ref $self->{'mungers'} eq "HASH" and %{$self->{'mungers'};}
4299 0 3 0 defined $self->{'missing'} and $self->{'missing'} eq "impute"
4428 0 6 20 $i > 0 and $$desc[$i - 1] == $v
4430 0 6 71 $j < $n and $desc->[$j] == $v
4432 0 2 4 $i > 0 and $k - $i < $j - $k
4654 17339 110730 111298 defined $v and $v < $split
4720 26240 55685 57761 not $missing and $dot <= $b
4757 1703 2186 963 defined $v && $v < $node->[2]
4771 1920 562 552 !$missing && $dot <= $b
4862 0 3806 25903 defined $n_features and $num == $n_features
4911 0 9 1207 ref $self->{'trees'} eq "ARRAY" and @{$self->{'trees'};}
4931 1 0 34 ref $tags eq "ARRAY" and @$tags
4948 0 0 15 ref $tags eq "ARRAY" and @$tags
5428 0 0 9 ref $fill eq "ARRAY" and @$fill == $self->{'n_features'}

or 2 conditions

line l !l condition
2739 61 152 $args{'mode'} // "axis"
2752 31 181 $args{'missing'} // "die"
2756 8 203 $args{'impute_with'} // "mean"
2768 25 185 $args{'voting'} // "mean"
2825 171 38 $args{'n_trees'} // 100
119 90 $args{'sample_size'} // 256
3929 38 1 $payload->{'params'} || {}
3933 39 0 $payload->{'trees'} || []
3934 38 1 $payload->{'version'} // 0
3970 38 1 $p->{'mode'} // "axis"
36 3 $p->{'missing'} // "zero"
36 3 $p->{'impute_with'} // "mean"
37 2 $p->{'voting'} // "mean"
4138 36 14 $proto->{'version'} // 1
4319 2 1 $self->{'schema_version'} // 0
2 1 $self->{'schema_description'} // "(none recorded; describe this schema and bump schema_version)"
4527 43954 0 rand() || 1e-12
4759 2650683 102385 $$x[$node->[1]] // 0
4774 486017 5238 $$x[$idx->[$_]] // 0
4981 2 0 $Config::Config{'d_fork'} || ''
5109 14 78 $self->{'extension_level_used'} // 0
5150 5 2 $self->{'extension_level_used'} // 0
5280 0 0 ref $data || 'scalar'

or 3 conditions

line l !l&&r !l&&!r condition
2740 178 34 1 $mode eq "axis" or $mode eq "extended"
2858 2 0 9 !($self->{'parallel_fit'} =~ /^\d+$/) || $self->{'parallel_fit'} < 1
4309 0 0 0 $self->{'extension_level_used'} // $self->{'extension_level'}
0 0 3 $self->{'extension_level_used'} // $self->{'extension_level'}
4572 87986 57977 149304 $depth >= $limit or $size <= 1
4590 47026 40418 611084 not defined $lo[$f] or $v < $lo[$f]
4591 47026 39500 612002 not defined $hi[$f] or $v > $hi[$f]
4598 286655 328482 6443277 not defined $lo[$f] or $v < $lo[$f]
4599 286655 326025 6445734 not defined $hi[$f] or $v > $hi[$f]
4968 947 5 0 $self->{'_munger_plan'} //= _compile_mungers($self->{'feature_names'}, $self->{'mungers'})
5082 0 0 26 $@ or ref $trees ne "ARRAY"
5429 3 6 0 $self->{'_fill_packed'} //= pack("d*", @$fill)