blib/lib/Net/Airbrake/Request.pm

filter: Statementstmt 100% 17 / 17 Branchbran 50.0% 1 / 2 Conditioncond 50.0% 4 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 72.9% 27 / 37 SCAR 18.3
CC
6
Cov
81%
to_json
7.6
BEGIN
1.0
BEGIN
1.0
CRAP 6.2
« blib/lib/Net/Airbrake.pm ↑ Summary blib/lib/Net/Airbrake/Error.pm »
1 package Net::Airbrake::Request;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use JSON qw(encode_json);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Class::Tiny qw(errors context environment session params);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub to_json {
10 2 ▶ my $self = shift;
Subroutine to_json: called CC=6 SCAR=20.3
Pod undocumented
11  
12 encode_json({
13 notifier => {
14 name => "Net-Airbrake/$Net::Airbrake::VERSION",
15 version => "$Net::Airbrake::VERSION",
16 url => 'https://github.com/sixapart/Net-Airbrake',
17 },
18 2 ▶ errors => [ map { $_->to_hash } @{$self->errors || []} ],
Branch: 1 branch
BranchTrueFalseTotal
$self->errors or [] 0 2 2
Condition50%4/8
$self->environment || {}
l!l
20
$self->context || {}
l!l
20
$self->session || {}
l!l
20
$self->params || {}
l!l
20
MC/DC0%0/1
$self->environment || {}
$self->environment
MC/DC0%0/1
$self->context || {}
$self->context
MC/DC0%0/1
$self->session || {}
$self->session
MC/DC0%0/1
$self->params || {}
$self->params
Truth table50%1/2
A
A= $self->environment
Aresult
11
00
Truth table50%1/2
A
A= $self->context
Aresult
11
00
Truth table50%1/2
A
A= $self->session
Aresult
11
00
Truth table50%1/2
A
A= $self->params
Aresult
11
00
19 environment => $self->environment || {},
20 context => $self->context || {},
21 session => $self->session || {},
22 params => $self->params || {},
23 });
24 }
25  
26 2 1;
27 __END__
28  
29 =pod
30  
31 =head1 NAME
32  
33 Net::Airbrake::Request - Request object
34  
35 =head1 SYNOPSIS
36  
37 use Net::Airbrake::Request;
38 my $req = Net::Airbrake::Request->new({
39 errors => $errors,
40 context => $context,
41 });
42  
43 =cut
« blib/lib/Net/Airbrake.pm ↑ Summary blib/lib/Net/Airbrake/Error.pm »