| 1 | package Bot::Cobalt::Core::ContextMeta::Ignore; | ||||||||||||||||||||||||||||
| 2 | $Bot::Cobalt::Core::ContextMeta::Ignore::VERSION = '0.021003'; | ||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strictures 2; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use IRC::Utils 'normalize_mask'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use Bot::Cobalt::Common ':types'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | extends 'Bot::Cobalt::Core::ContextMeta'; | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | around add => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||
| 15 | 0 | my $orig = shift; | |||||||||||||||||||||||||||
| 16 | 0 | my ($self, $context, $mask, $reason, $addedby) = @_; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | my ($pkg, $line) = (caller)[0,2]; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | confess "Missing arguments in ignore add()" | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $context and defined $mask
MC/DC0%0/2
defined $context and defined $mask
defined $context
defined $mask
Truth table0%0/3
A and B
A= defined $contextB= defined $mask
| |||||||||||||||||||||||||||||
| 21 | unless defined $context and defined $mask; | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | $mask = normalize_mask($mask); | |||||||||||||||||||||||||||
| 24 | 0 | ▶ | $addedby = $pkg unless defined $addedby; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | $reason = "Added by $pkg" unless defined $reason; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | my $meta = +{ | |||||||||||||||||||||||||||
| 28 | AddedBy => $addedby, | ||||||||||||||||||||||||||||
| 29 | Reason => $reason, | ||||||||||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | $self->$orig($context, $mask, $meta) | |||||||||||||||||||||||||||
| 33 | }; | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub reason { | ||||||||||||||||||||||||||
|
Subroutine
reason: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | 0 | my ($self, $context, $mask) = @_; | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | return unless exists $self->_list->{$context} | ||||||||||||||||||||||||||||
| 39 | 0 | ▶ | and exists $self->_list->{$context}->{$mask}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $self->_list->{$context} and exists $self->_list->{$context}{$mask}
MC/DC0%0/2
exists $self->_list->{$context} and exists $self->_list->{$context}{$mask}
exists $self->_list->{$context}
exists $self->_list->{$context}{$mask}
Truth table0%0/3
A and B
A= exists $self->_list->{$context}B= exists $self->_list->{$context}{$mask}
| |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | $self->_list->{$context}->{$mask}->{Reason} | ||||||||||||||||||||||||||||
| 42 | 0 | } | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub addedby { | ||||||||||||||||||||||||||
|
Subroutine
addedby: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 45 | 0 | my ($self, $context, $mask) = @_; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | return unless exists $self->_list->{$context} | ||||||||||||||||||||||||||||
| 48 | 0 | ▶ | and exists $self->_list->{$context}->{$mask}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $self->_list->{$context} and exists $self->_list->{$context}{$mask}
MC/DC0%0/2
exists $self->_list->{$context} and exists $self->_list->{$context}{$mask}
exists $self->_list->{$context}
exists $self->_list->{$context}{$mask}
Truth table0%0/3
A and B
A= exists $self->_list->{$context}B= exists $self->_list->{$context}{$mask}
| |||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | $self->_list->{$context}->{$mask}->{AddedBy} | ||||||||||||||||||||||||||||
| 51 | 0 | } | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 1; | ||||||||||||||||||||||||||||
| 54 | __END__ | ||||||||||||||||||||||||||||