DeploymentHandler/LogRouter.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 73.6% 28 / 38 CC 3 SCAR 5.9
CC
3
Cov
81%
handle_log_request
3.4
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« DeploymentHandler.pm ↑ Summary DeploymentHandler/LogImporter.pm »
1 package DBIx::Class::DeploymentHandler::LogRouter;
2 20 $DBIx::Class::DeploymentHandler::LogRouter::VERSION = '0.002233';
3 20 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use DBIx::Class::DeploymentHandler::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 20 with 'Log::Contextual::Role::Router';
7  
8 has _logger => (
9 is => 'lazy',
10 10 ▶ builder => sub { DBIx::Class::DeploymentHandler::Logger->new },
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine _build__logger: called CC=1 SCAR=0.0
11 20 );
12  
13 sub handle_log_request {
14 409 ▶ my ($self, %message_info) = @_;
Subroutine handle_log_request: called CC=3 SCAR=12.3
Pod undocumented
15  
16 409 my $log_code_block = $message_info{message_sub};
17 409 my $args = $message_info{message_args};
18 409 my $log_level_name = $message_info{message_level};
19 409 my $logger = $self->_logger;
20 409 my $is_active = $logger->can("is_${log_level_name}");
21  
22 409 ▶ return unless defined $is_active && $logger->$is_active;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $is_active and $logger->$is_active 409 0 409
Condition33%1/3
defined $is_active and $logger->$is_active
!ll&&!rl&&r
04090
MC/DC0%0/2
defined $is_active and $logger->$is_active
defined $is_active $logger->$is_active
Truth table33%1/3
A and B
A= defined $is_activeB= $logger->$is_active
ABresult
0X0
100
111
23  
24 0 my $log_message = $log_code_block->(@$args);
25  
26 0 $self->_logger->$log_level_name($log_message);
27 }
28  
29 ▶sub before_import {}
Subroutine before_import: called CC=1 SCAR=0.0
Pod undocumented
30 ▶sub after_import {}
Subroutine after_import: called CC=1 SCAR=0.0
Pod undocumented
31  
32 20 1;
« DeploymentHandler.pm ↑ Summary DeploymentHandler/LogImporter.pm »