RabbitFoot/Cmd/Command/unbind_queue.pm

filter: Statementstmt 44.8% 13 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 28.5% 2 / 7 Podpod 100% 1 / 1 totaltotal 39.0% 16 / 41 CC 3 SCAR 16.3
CC
3
Cov
39%
_validate_routing_key
12.0
abstract
2.0
_validate_queue
2.0
CRAP 5.1
« RabbitFoot/Cmd/Command/bind_queue.pm ↑ Summary RabbitFoot/Cmd/Command/declare_queue.pm »
1 package Net::RabbitFoot::Cmd::Command::unbind_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 exchange => (
17 isa => 'Str',
18 is => 'rw',
19 required => 1,
20 metaclass => 'MooseX::Getopt::Meta::Attribute',
21 cmd_aliases => 'e',
22 documentation => 'exchange name',
23 );
24  
25 1 has routing_key => (
26 isa => 'Str',
27 is => 'rw',
28 metaclass => 'MooseX::Getopt::Meta::Attribute',
29 cmd_aliases => 'r',
30 documentation => 'message routing key',
31 );
32  
33 1 __PACKAGE__->meta->make_immutable;
34 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
35  
36 0 ▶sub abstract {
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
37 0 return 'unbind queue to an exchange';
38 }
39  
40 0 ▶sub _validate_queue {
Subroutine _validate_queue: not called CC=1 SCAR=6.9
41 0 my ($self,) = @_;
42  
43 0 $self->_check_queue();
44 0 return;
45 }
46  
47 0 ▶sub _validate_exchange {
Subroutine _validate_exchange: not called CC=1 SCAR=6.9
48 0 my ($self,) = @_;
49  
50 0 $self->_check_shortstr('exchange');
51 0 return;
52 }
53  
54 0 ▶sub _validate_routing_key {
Subroutine _validate_routing_key: not called CC=3 SCAR=24.8
55 0 my ($self,) = @_;
56  
57 0 ▶ return if !$self->routing_key;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->routing_key 0 0 0
58 0 ▶ die 'routing_key', "\n" if 255 < length($self->routing_key);
Branch: 1 branch
BranchTrueFalseTotal
if 255 < length $self->routing_key 0 0 0
59 0 return;
60 }
61  
62 0 ▶sub _run {
Subroutine _run: not called CC=1 SCAR=6.9
63 0 my ($self, $client, $opt, $args,) = @_;
64  
65 my $method_frame = $client->unbind_queue(
66 0 (map {$_ => $self->$_} qw(queue exchange routing_key))
67 )->method_frame;
68  
69 0 print 'Unbound queue to exchange', "\n";
70 0 return;
71 }
72  
73 1 1;
74  
« RabbitFoot/Cmd/Command/bind_queue.pm ↑ Summary RabbitFoot/Cmd/Command/declare_queue.pm »