OpenInteract2/Observer/Controller/GetFiltersFromRequest.pm

filter: Statementstmt 60.0% 15 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 40.4% 19 / 47 CC 7 SCAR 35.8
CC
7
Cov
41%
update
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 36.0
« OpenInteract2/Util.pm ↑ Summary OpenInteract2/File.pm »
1 package OpenInteract2::Observer::Controller::GetFiltersFromRequest;
2  
3 # $Id: GetFiltersFromRequest.pm,v 1.2 2005/02/14 18:23:24 lachoy Exp $
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Log::Log4perl qw( get_logger );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use OpenInteract2::Constants qw( LOG_ACTION );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use OpenInteract2::Context qw( CTX );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 $OpenInteract2::Observer::Controller::GetFiltersFromRequest::VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);
11  
12 1 my ( $log );
13  
14 0 ▶sub update {
Subroutine update: not called CC=7 SCAR=40.3
Pod undocumented
15 0 my ( $class, $controller, $type, $action ) = @_;
16 0 ▶ return unless ( $type eq 'action assigned' and $action );
Branch: 1 branch
BranchTrueFalseTotal
unless $type eq "action assigned" and $action 0 0 0
Condition0%0/3
$type eq "action assigned" and $action
!ll&&!rl&&r
000
MC/DC0%0/2
$type eq "action assigned" and $action
$type eq "action assigned" $action
Truth table0%0/3
A and B
A= $type eq "action assigned"B= $action
ABresult
0X0
100
111
17 0 my $request = CTX->request;
18 0 my @filter_add = $request->param( 'OI_FILTER' );
19 0 ▶ return unless ( scalar @filter_add );
Branch: 1 branch
BranchTrueFalseTotal
unless scalar @filter_add 0 0 0
20 0 ▶ $log ||= get_logger( LOG_ACTION );
Condition0%0/3
$log ||= get_logger("OI2.ACTION")
l!l&&r!l&&!r
000
MC/DC0%0/2
$log ||= get_logger("OI2.ACTION")
$log get_logger("OI2.ACTION")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.ACTION")
ABresult
1X1
011
000
21 0 foreach my $filter_name ( @filter_add ) {
22 0 ▶ next unless ( $filter_name );
Branch: 1 branch
BranchTrueFalseTotal
unless $filter_name 0 0 0
23 0 CTX->map_observer( $filter_name, $action );
24 0 $log->info( "Added from request parameter an action filter ",
25 "'$filter_name' to action '", $action->name, "'" );
26 }
27 }
28  
29 1 1;
30  
31 __END__
« OpenInteract2/Util.pm ↑ Summary OpenInteract2/File.pm »