Tapper/Schema/TestrunDB/Result/ReportgroupTestrun.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 2 / 2 totaltotal 100% 38 / 38 CC 2 SCAR 2.5
CC
2
Cov
100%
groupreports
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Tapper/Schema/TestrunDB/Result/ReportSection.pm ↑ Summary Tapper/Schema/TestrunDB.pm »
1 package Tapper::Schema::TestrunDB::Result::ReportgroupTestrun;
2 10 our $AUTHORITY = 'cpan:TAPPER';
3 10 $Tapper::Schema::TestrunDB::Result::ReportgroupTestrun::VERSION = '5.0.12';
4 # ABSTRACT: Tapper - Containing relations between testruns and reports
5  
6 10 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 10 ▶use parent 'DBIx::Class';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 10 __PACKAGE__->load_components("Core");
13 10 __PACKAGE__->table("reportgrouptestrun");
14 10 __PACKAGE__->add_columns
15 (
16 "testrun_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, },
17 "report_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 11, is_foreign_key => 1, },
18 "primaryreport", { data_type => "INT", default_value => undef, is_nullable => 1, size => 11, },
19 "owner", { data_type => "VARCHAR", default_value => undef, is_nullable => 1, size => 255, },
20 );
21  
22 10 __PACKAGE__->set_primary_key(qw/testrun_id report_id/);
23  
24 10 __PACKAGE__->might_have ( reportgrouptestrunstats => 'Tapper::Schema::TestrunDB::Result::ReportgroupTestrunStats', { 'foreign.testrun_id' => 'self.testrun_id' }, { is_foreign_key_constraint => 0 } );
25 10 __PACKAGE__->belongs_to ( report => 'Tapper::Schema::TestrunDB::Result::Report', { 'foreign.id' => 'self.report_id' } );
26  
27 # -------------------- methods on results --------------------
28  
29  
30 3 ▶sub groupreports {
Subroutine groupreports: called CC=2 SCAR=6.9
Pod documented
31 3 my ($self) = @_;
32  
33 3 my @report_ids;
34 3 my $rg = $self->result_source->schema->resultset('ReportgroupTestrun')->search({ testrun_id => $self->testrun_id });
35 3 ▶ while (my $rg_entry = $rg->next) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $rg_entry = $rg->next) 9 3 12
36 9 push @report_ids, $rg_entry->report_id;
37 }
38 3 return $self->result_source->schema->resultset('Report')->search({ id => [ -or => [ @report_ids ] ] });
39 }
40  
41  
42 sub sqlt_deploy_hook
43 8 ▶{
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
44 8 my ($self, $sqlt_table) = @_;
45 8 $sqlt_table->add_index(name => 'reportgrouptestrun_idx_report_id', fields => ['report_id']);
46 }
47  
48 10 1;
49  
50 __END__
« Tapper/Schema/TestrunDB/Result/ReportSection.pm ↑ Summary Tapper/Schema/TestrunDB.pm »