blib/lib/Pinto/Action/Kill.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 40 / 40 CC 3 SCAR 5.6
CC
3
Cov
100%
execute
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« blib/lib/Pinto/RevisionWalker.pm ↑ Summary blib/lib/Pinto/ModlistWriter.pm »
1 # ABSTRACT: Permanently delete a stack
2  
3 package Pinto::Action::Kill;
4  
5 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use MooseX::Types::Moose qw(Bool);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use MooseX::MarkAsMethods ( autoclean => 1 );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Pinto::Types qw(StackName StackObject);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #------------------------------------------------------------------------------
13  
14 2 our $VERSION = '0.14'; # VERSION
15  
16 #------------------------------------------------------------------------------
17  
18 2 extends qw( Pinto::Action );
19  
20 #------------------------------------------------------------------------------
21  
22 2 with qw( Pinto::Role::Transactional );
23  
24 #------------------------------------------------------------------------------
25  
26 2 has stack => (
27 is => 'ro',
28 isa => StackName | StackObject,
29 required => 1,
30 );
31  
32 2 has force => (
33 is => 'ro',
34 isa => Bool,
35 default => 0,
36 );
37  
38 #------------------------------------------------------------------------------
39  
40 4 ▶sub execute {
Subroutine execute: called CC=3 SCAR=11.0
41 4 my ($self) = @_;
42  
43 4 my $stack = $self->repo->get_stack( $self->stack );
44  
45 4 ▶ $stack->unlock if $stack->is_locked && $self->force;
Branch: 1 branch
BranchTrueFalseTotal
if $stack->is_locked and $self->force 1 3 4
Condition100%3/3
$stack->is_locked and $self->force
!ll&&!rl&&r
211
MC/DC100%2/2
$stack->is_locked and $self->force
$stack->is_locked $self->force
Truth table100%3/3
A and B
A= $stack->is_lockedB= $self->force
ABresult
0X0
100
111
46  
47 4 $self->repo->kill_stack( stack => $stack );
48  
49 2 return $self->result->changed;
50 }
51  
52 #------------------------------------------------------------------------------
53  
54 2 __PACKAGE__->meta->make_immutable;
55  
56 #------------------------------------------------------------------------------
57  
58 2 1;
59  
60 __END__
« blib/lib/Pinto/RevisionWalker.pm ↑ Summary blib/lib/Pinto/ModlistWriter.pm »