RabbitFoot/Cmd/Command/delete_queue.pm

filter: Statementstmt 56.5% 13 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 100% 1 / 1 totaltotal 55.1% 16 / 29 CC 1 SCAR 4.7
CC
1
Cov
57%
abstract
2.0
_validate_queue
2.0
_run
2.0
CRAP 1.6
« RabbitFoot/Cmd/Command/purge_queue.pm ↑ Summary RabbitFoot/Cmd/Command/delete_exchange.pm »
1 package Net::RabbitFoot::Cmd::Command::delete_queue;
2  
3 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 extends qw(MooseX::App::Cmd::Command);
5 1 with qw(Net::RabbitFoot::Cmd::Role::Config Net::RabbitFoot::Cmd::Role::Command);
6  
7 1 has queue => (
8 isa => 'Str',
9 is => 'rw',
10 required => 1,
11 metaclass => 'MooseX::Getopt::Meta::Attribute',
12 cmd_aliases => 'q',
13 documentation => 'queue name',
14 );
15  
16 1 has if_unused => (
17 isa => 'Bool',
18 is => 'rw',
19 default => 0,
20 metaclass => 'MooseX::Getopt::Meta::Attribute',
21 cmd_aliases => 'U',
22 documentation => 'delete only if unused',
23 );
24  
25 1 has if_empty => (
26 isa => 'Bool',
27 is => 'rw',
28 default => 0,
29 metaclass => 'MooseX::Getopt::Meta::Attribute',
30 cmd_aliases => 'e',
31 documentation => 'delete only if empty',
32 );
33  
34 1 __PACKAGE__->meta->make_immutable;
35 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 0 ▶sub abstract {
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
38 0 return 'delete a queue';
39 }
40  
41 0 ▶sub _validate_queue {
Subroutine _validate_queue: not called CC=1 SCAR=6.9
42 0 my ($self,) = @_;
43  
44 0 $self->_check_queue();
45 0 return;
46 }
47  
48 0 ▶sub _run {
Subroutine _run: not called CC=1 SCAR=6.9
49 0 my ($self, $client, $opt, $args,) = @_;
50  
51 my $method_frame = $client->delete_queue(
52 0 (map {$_ => $self->$_} qw(queue if_unused if_empty))
53 )->method_frame;
54  
55 0 print 'Deleted queue', "\n";
56 0 print 'message_count: ', $method_frame->message_count, "\n";
57 0 return;
58 }
59  
60 1 1;
61  
« RabbitFoot/Cmd/Command/purge_queue.pm ↑ Summary RabbitFoot/Cmd/Command/delete_exchange.pm »