EPrints/Mapping/EPrints.pm

filter: Statementstmt 100% 23 / 23 Branchbran 91.6% 11 / 12 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 93.6% 44 / 47 CC 8 SCAR 15.4
CC
8
Cov
97%
hit
7.0
new
2.0
BEGIN
1.0
CRAP 4.7
« EPrints/Filter/Repeated.pm ↑ Summary EPrints/Hit.pm »
1 package Logfile::EPrints::Mapping::EPrints;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod undocumented
7 4 my ($class,%self) = @_;
8  
9 4 ▶ Carp::croak(__PACKAGE__." requires identifier argument") unless exists $self{identifier};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self{"identifier"} 0 4 4
10  
11 4 bless \%self, $class;
12 }
13  
14 1146 ▶sub hit {
Subroutine hit: called CC=7 SCAR=19.5
Pod undocumented
15 1146 my ($self,$hit) = @_;
16 1146 ▶ if( 'GET' eq $hit->method && 200 == $hit->code ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("GET" eq $hit->method and 200 == $hit->code) 725 421 1146
Condition100%3/3
"GET" eq $hit->method and 200 == $hit->code
!ll&&!rl&&r
2419725
MC/DC100%2/2
"GET" eq $hit->method and 200 == $hit->code
"GET" eq $hit->method 200 == $hit->code
Truth table100%3/3
A and B
A= "GET" eq $hit->methodB= 200 == $hit->code
ABresult
0X0
100
111
17 725 my $path = URI->new($hit->page,'http')->path;
18 # Full text
19 725 ▶ if( $path =~ /^(?:\/archive)?\/(\d+)\/\d/ ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($path =~ m[^(?:/archive)?/(\d+)/\d]) { } 64 661 725
elsif ($path =~ m[^(?:/archive)?/(\d+)/?$]) { } 154 507 661
elsif ($path =~ m[^/view/(\w+)/]) { } 197 310 507
elsif ($path =~ m[^/perl/search]) { } 10 300 310
20 64 $hit->{identifier} = $self->_identifier($1);
21 64 $self->{handler}->fulltext($hit);
22 } elsif( $path =~ /^(?:\/archive)?\/(\d+)\/?$/ ) {
23 154 $hit->{identifier} = $self->_identifier($1);
24 154 $self->{handler}->abstract($hit);
25 } elsif( $path =~ /^\/view\/(\w+)\// ) {
26 197 $hit->{section} = $1;
27 197 $self->{handler}->browse($hit);
28 } elsif( $path =~ /^\/perl\/search/ ) {
29 10 $self->{handler}->search($hit);
30 } else {
31 #warn "Unknown path = ", $uri->path, "\n";
32 }
33 }
34 }
35  
36 218 ▶sub _identifier {
Subroutine _identifier: called CC=1 SCAR=0.0
37 218 my ($self,$no) = @_;
38 218 return $self->{'identifier'}.($no+0);
39 }
40  
41 # Autoload methods go after =cut, and are processed by the autosplit program.
42  
43 6 1;
44 __END__
« EPrints/Filter/Repeated.pm ↑ Summary EPrints/Hit.pm »