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

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