blib/lib/Web/JenkinsNotification.pm

filter: Statementstmt 97.5% 39 / 40 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 96.3% 52 / 54 CC 2 SCAR 1.6
CC
2
Cov
95%
call
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
↑ Summary
1 package Web::JenkinsNotification;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our $VERSION = '0.05';
5 2 ▶use parent qw/Plack::Middleware/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Plack::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Plack::MIME;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Plack::Util::Accessor qw(on_notify);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Plack::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Plack::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 ▶use Net::Jenkins;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use Jenkins::NotificationListener;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶sub call {
Subroutine call: called CC=2 SCAR=7.1
Pod documented
15 1 my ($self,$env) = @_;
16  
17 1 my $req = Plack::Request->new($env);
18 1 my $body = $req->raw_body;
19  
20 1 my $notification = parse_jenkins_notification $body;
21  
22 1 ▶ if( $self->on_notify ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->on_notify) 0 1 1
23 0 $self->on_notify->( $env, $notification );
24 }
25 1 $env->{ 'jenkins.notification' } = $notification;
26  
27 1 return $self->app->( $env );
28 }
29  
30 2 1;
31 __END__
↑ Summary