Mojolicious/Plugin/Logite.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 85.2% 29 / 34 CC 4 SCAR 9.5
CC
4
Cov
88%
register
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« MojoX/Logite.pm ↑ Summary
1 package Mojolicious::Plugin::Logite;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base 'Mojolicious::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use MojoX::Logite;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub register
11 1 ▶{
Subroutine register: called CC=4 SCAR=14.3
Pod documented
12 1 my ($self, $app, $conf) = @_;
13  
14 1 ▶ $conf ||= {};
Condition50%1/2
$conf ||= {}
l!l
10
MC/DC0%0/1
$conf ||= {}
$conf
Truth table50%1/2
A
A= $conf
Aresult
11
00
15  
16 1 ▶ my $stash_key = delete $conf->{stash_key} || 'logite';
Condition50%1/2
delete $conf->{'stash_key'} || 'logite'
l!l
01
MC/DC0%0/1
delete $conf->{'stash_key'} || 'logite'
delete $conf->{'stash_key'}
Truth table50%1/2
A
A= delete $conf->{'stash_key'}
Aresult
11
00
17  
18 $conf->{'path'} = $app->home->rel_file('log/mojo_log.db')
19 1 ▶ unless (exists $conf->{'path'});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $conf->{"path"} 0 1 1
20  
21 1 my $logite = MojoX::Logite->new (%$conf);
22  
23 # Default
24 1 $app->defaults($stash_key => $logite);
25  
26 1 return $logite;
27 }
28  
29 1 1;
30 __END__
« MojoX/Logite.pm ↑ Summary