blib/lib/Tapper/Reports/Web/Controller/Tapper/Reports/Tap.pm

filter: Statementstmt 55.5% 15 / 27 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 44.1% 19 / 43 CC 5 SCAR 28.4
CC
5
Cov
42%
index
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« blib/lib/Tapper/Reports/Web/Controller/Tapper/Testruns.pm ↑ Summary blib/lib/Tapper/Reports/Web/Util/Filter/Report.pm »
1 package Tapper::Reports::Web::Controller::Tapper::Reports::Tap;
2 13 our $AUTHORITY = 'cpan:TAPPER';
3 13 $Tapper::Reports::Web::Controller::Tapper::Reports::Tap::VERSION = '5.0.17';
4 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 ▶use parent 'Tapper::Reports::Web::Controller::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub index :Path :Args(1)
Subroutine index: not called CC=5 SCAR=34.0
10 {
11 0 my ( $self, $c, $report_id ) = @_;
12  
13 0 my $report = $c->model('TestrunDB')->resultset('Report')->find($report_id);
14  
15 0 ▶ if ($report) {
Branch: 1 branch
BranchTrueFalseTotal
if ($report) { } 0 0 0
16 0 ▶ if ($report->tap && $report->tap->tap_is_archive) {
Branch: 1 branch
BranchTrueFalseTotal
if ($report->tap and $report->tap->tap_is_archive) { } 0 0 0
Condition0%0/3
$report->tap and $report->tap->tap_is_archive
!ll&&!rl&&r
000
MC/DC0%0/2
$report->tap and $report->tap->tap_is_archive
$report->tap $report->tap->tap_is_archive
Truth table0%0/3
A and B
A= $report->tapB= $report->tap->tap_is_archive
ABresult
0X0
100
111
17 0 $c->response->content_type ('application/x-compressed');
18 0 $c->response->header ("Content-Disposition" => 'inline; filename="tap-'.$report_id.'.tgz"');
19 } else {
20 0 $c->response->content_type ('text/plain');
21 0 $c->response->header ("Content-Disposition" => 'inline; filename="tap-'.$report_id.'.tap"');
22 }
23 0 ▶ $c->response->body ($report->tap ? $report->tap->tap : "Error: No TAP for report $report_id.");
Branch: 1 branch
BranchTrueFalseTotal
$report->tap ? : 0 0 0
24 } else {
25 0 $c->response->content_type ("text/plain");
26 0 $c->response->header ("Content-Disposition" => 'inline; filename="nonexistent.report.tap.'.$report_id.'"');
27 0 $c->response->body ("Error: No report $report_id.");
28 }
29 13 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 13 1;
32  
33 __END__
« blib/lib/Tapper/Reports/Web/Controller/Tapper/Testruns.pm ↑ Summary blib/lib/Tapper/Reports/Web/Util/Filter/Report.pm »