| 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} ||= []
MC/DC100%1/1
$node_keys{$resolved} ||= []
$node_keys{$resolved}
Truth table100%2/2
A
A= $node_keys{$resolved}
| |||||||||||||
| 20 | 49 | ▶ | if ($resolver->is_cluster($resolved)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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
| |||||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 6 | 1; | |||||||||||
| 40 | |||||||||||||