RuledCluster/Strategy.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 3 totaltotal 88.8% 40 / 45 CC 5 SCAR 8.6
CC
5
Cov
97%
resolve_node_keys
4.0
resolve
2.0
keys_from_args
2.0
CRAP 2.4
« RuledCluster.pm ↑ Summary RuledCluster/Strategy/Formatted.pm »
1 package Data::RuledCluster::Strategy;
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Data::Util qw(is_array_ref);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub resolve { Carp::croak('Not implement') }
Subroutine resolve: not called CC=1 SCAR=6.9
Pod undocumented
8  
9 23 ▶sub resolve_node_keys {
Subroutine resolve_node_keys: called CC=4 SCAR=13.9
Pod undocumented
10 23 my ($class, $resolver, $cluster_or_node, $args, $options) = @_;
11  
12 23 my %node_keys;
13 23 for my $key ($class->keys_from_args($args)) {
14 49 my %args = %$args;
15 49 $args{key} = $key;
16  
17 49 my ($resolved, @keys) = $class->resolve($resolver, $cluster_or_node, \%args, $options);
18  
19 49 ▶ my $node_keys = $node_keys{ $resolved } ||= [];
Condition100%2/2
$node_keys{$resolved} ||= []
l!l
1732
MC/DC100%1/1
$node_keys{$resolved} ||= []
$node_keys{$resolved}
Truth table100%2/2
A
A= $node_keys{$resolved}
Aresult
11
00
20 49 ▶ if ($resolver->is_cluster($resolved)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($resolver->is_cluster($resolved)) { } 16 33 49
21 16 push @$node_keys, {
22 root => $key,
23 next => \@keys,
24 };
25 }
26 else {
27 33 push @$node_keys, $key;
28 }
29 }
30  
31 23 return %node_keys;
32 }
33  
34 108 ▶sub keys_from_args {
Subroutine keys_from_args: called CC=2 SCAR=6.9
Pod undocumented
35 108 my ( $class, $args ) = @_;
36 108 ▶ return is_array_ref( $args->{key} ) ? @{ $args->{key} } : ( $args->{key} );
Branch: 1 branch
BranchTrueFalseTotal
is_array_ref($args->{'key'}) ? : 30 78 108
37 }
38  
39 6 1;
40  
« RuledCluster.pm ↑ Summary RuledCluster/Strategy/Formatted.pm »