« blib/lib/Tapper/Reports/Web/Controller/Tapper/Reports/Tap.pm
↑ Summary
blib/lib/Tapper/Reports/Web/Controller/Tapper/Testplan/Id.pm »
| 1 | package Tapper::Reports::Web::Util::Filter::Report; | ||||||||||||
| 2 | 17 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||
| 3 | 17 | $Tapper::Reports::Web::Util::Filter::Report::VERSION = '5.0.17'; | |||||||||||
| 4 | 17 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 17 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | |||||||||||||
| 8 | |||||||||||||
| 9 | |||||||||||||
| 10 | 17 | ▶ | use Moose; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 17 | ▶ | use Hash::Merge::Simple 'merge'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | 17 | ▶ | use Set::Intersection 'get_intersection'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 17 | ▶ | use Tapper::Model 'model'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | |||||||||||||
| 16 | 17 | extends 'Tapper::Reports::Web::Util::Filter'; | |||||||||||
| 17 | |||||||||||||
| 18 | 4 | ▶ | sub BUILD { | ||||||||||
|
Subroutine
BUILD: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||||
| 19 | |||||||||||||
| 20 | 4 | my $self = shift; | |||||||||||
| 21 | 4 | my $args = shift; | |||||||||||
| 22 | |||||||||||||
| 23 | $self->dispatch( | ||||||||||||
| 24 | merge( | ||||||||||||
| 25 | $self->dispatch, | ||||||||||||
| 26 | { | ||||||||||||
| 27 | suite => \&suite, | ||||||||||||
| 28 | success => \&success, | ||||||||||||
| 29 | 0 | ▶ | owner => sub { hr_set_filter_default( @_, 'owner' ); }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 30 | 0 | ▶ | host => sub { hr_set_filter_default( @_, 'host' ); }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 31 | 0 | ▶ | idlist => sub { hr_set_filter_default( @_, 'report_id' ); }, | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||
| 32 | } | ||||||||||||
| 33 | ) | ||||||||||||
| 34 | 4 | ); | |||||||||||
| 35 | |||||||||||||
| 36 | } | ||||||||||||
| 37 | |||||||||||||
| 38 | |||||||||||||
| 39 | sub suite | ||||||||||||
| 40 | 0 | ▶ | { | ||||||||||
|
Subroutine
suite: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 41 | 0 | my ($self, $filter_condition, $suite) = @_; | |||||||||||
| 42 | 0 | my $suite_id; | |||||||||||
| 43 | 0 | ▶ | if ($suite =~/^\d+$/) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 44 | 0 | $suite_id = $suite; | |||||||||||
| 45 | } else { | ||||||||||||
| 46 | 0 | my $suite_rs = $self->context->model('TestrunDB')->resultset('Suite')->search({name => $suite}); | |||||||||||
| 47 | 0 | ▶ | $suite_id = $suite_rs->search({}, {rows => 1})->first->id if $suite_rs->count; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | 0 | my @suites; | |||||||||||
| 51 | 0 | ▶ | @suites = @{$filter_condition->{suite_id}} if $filter_condition->{suite_id}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 52 | 0 | push @suites, $suite_id; | |||||||||||
| 53 | |||||||||||||
| 54 | 0 | $filter_condition->{suite_id} = \@suites; | |||||||||||
| 55 | 0 | return $filter_condition; | |||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | |||||||||||||
| 59 | sub success | ||||||||||||
| 60 | 0 | ▶ | { | ||||||||||
|
Subroutine
success: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 61 | 0 | my ($self, $filter_condition, $success) = @_; | |||||||||||
| 62 | |||||||||||||
| 63 | 0 | ▶ | if ( $success =~/^\d+$/ ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 64 | 0 | ▶ | push @{$filter_condition->{success_ratio} ||= []}, int($success); | ||||||||||
|
Condition0%0/2
$filter_condition->{"success_ratio"} ||= []
MC/DC0%0/1
$filter_condition->{"success_ratio"} ||= []
$filter_condition->{"success_ratio"}
Truth table0%0/2
A
A= $filter_condition->{"success_ratio"}
| |||||||||||||
| 65 | } | ||||||||||||
| 66 | else { | ||||||||||||
| 67 | 0 | ▶ | push @{$filter_condition->{successgrade} ||= []}, uc($success); | ||||||||||
|
Condition0%0/2
$filter_condition->{"successgrade"} ||= []
MC/DC0%0/1
$filter_condition->{"successgrade"} ||= []
$filter_condition->{"successgrade"}
Truth table0%0/2
A
A= $filter_condition->{"successgrade"}
| |||||||||||||
| 68 | } | ||||||||||||
| 69 | 0 | return $filter_condition; | |||||||||||
| 70 | |||||||||||||
| 71 | } | ||||||||||||
| 72 | |||||||||||||
| 73 | 0 | ▶ | sub hr_set_filter_default { | ||||||||||
|
Subroutine
hr_set_filter_default: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 74 | 0 | my ( $or_self, $hr_filter, $value, $s_filter_name ) = @_; | |||||||||||
| 75 | 0 | ▶ | push @{$hr_filter->{$s_filter_name} ||= []}, $value; | ||||||||||
|
Condition0%0/2
$hr_filter->{$s_filter_name} ||= []
MC/DC0%0/1
$hr_filter->{$s_filter_name} ||= []
$hr_filter->{$s_filter_name}
Truth table0%0/2
A
A= $hr_filter->{$s_filter_name}
| |||||||||||||
| 76 | 0 | return $hr_filter; | |||||||||||
| 77 | } | ||||||||||||
| 78 | |||||||||||||
| 79 | 17 | 1; | |||||||||||
| 80 | |||||||||||||
| 81 | __END__ | ||||||||||||