blib/lib/Games/Solitaire/BlackHole/Solver/App.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 97.1% 34 / 35 SCAR 13.9
CC
4
Cov
97%
run
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« Build ↑ Summary bin/black-hole-solve »
1 package Games::Solitaire::BlackHole::Solver::App;
2 5 $Games::Solitaire::BlackHole::Solver::App::VERSION = '0.6.0';
3 5 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 extends('Games::Solitaire::BlackHole::Solver::App::Base');
7  
8  
9 sub run
10 {
11 4 ▶ my $self = shift;
Subroutine run: called CC=4 SCAR=13.9
Pod documented
12 4 my $RANK_KING = $self->_RANK_KING;
13  
14 4 $self->_process_cmd_line(
15 {
16 extra_flags => {}
17 }
18 );
19  
20 4 $self->_set_up_solver( 0, [ 1, $RANK_KING ] );
21  
22 4 my $verdict = 0;
23  
24 4 $self->_next_task;
25  
26 QUEUE_LOOP:
27 4 ▶ while ( my $state = $self->_get_next_state_wrapper )
Branch: 1 branch
BranchTrueFalseTotal
if (my $state = $self->_get_next_state_wrapper) 17281 2 17283
28 {
29 # The foundation
30 17281 my $no_cards = 1;
31  
32 17281 my @_pending;
33  
34 17281 if (1)
35 {
36 17281 $self->_find_moves( \@_pending, $state, \$no_cards );
37 }
38  
39 17281 ▶ if ($no_cards)
Branch: 1 branch
BranchTrueFalseTotal
if ($no_cards) 2 17279 17281
40 {
41 2 $self->_trace_solution( $state, );
42 2 $verdict = 1;
43 2 last QUEUE_LOOP;
44 }
45 last QUEUE_LOOP
46 17279 ▶ if not $self->_process_pending_items( \@_pending, $state );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_process_pending_items(\@_pending, $state) 0 17279 17279
47 }
48  
49 4 return $self->_my_exit( $verdict, );
50 }
51  
52  
53 5 1;
54  
55 __END__
« Build ↑ Summary bin/black-hole-solve »