COUNTER/Report/Release2/DatabaseReport1.pm

filter: Statementstmt 37.9% 11 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 0.0% 0 / 6 totaltotal 29.1% 14 / 48 CC 3 SCAR 14.9
CC
3
Cov
33%
process_record
12.0
canonical_report_name
2.0
canonical_report_description
2.0
CRAP 4.5
« COUNTER/Processor/Simple.pm ↑ Summary COUNTER/Report/Release2/DatabaseReport3.pm »
1 package Biblio::COUNTER::Report::Release2::DatabaseReport1;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Biblio::COUNTER::Report qw(REQUESTS SEARCHES SESSIONS MAY_BE_BLANK NOT_BLANK EXACT_MATCH);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 @Biblio::COUNTER::Report::Release2::DatabaseReport1::ISA = qw(Biblio::COUNTER::Report);
9  
10 0 ▶sub canonical_report_name { 'Database Report 1 (R2)' }
Subroutine canonical_report_name: not called CC=1 SCAR=6.9
Pod undocumented
11 0 ▶sub canonical_report_description { 'Total Searches and Sessions by Month and Database' }
Subroutine canonical_report_description: not called CC=1 SCAR=6.9
Pod undocumented
12 0 ▶sub canonical_report_code { 'DB1' }
Subroutine canonical_report_code: not called CC=1 SCAR=6.9
Pod undocumented
13 0 ▶sub release_number { 2 }
Subroutine release_number: not called CC=1 SCAR=6.9
Pod undocumented
14  
15 0 ▶sub process_header_rows {
Subroutine process_header_rows: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my ($self) = @_;
17
18 # Report name and title
19 0 $self->begin_row
20 ->check_report_name
21 ->check_report_description
22 ->end_row;
23
24 # Report criteria
25 0 $self->begin_row
26 ->check_report_criteria
27 ->end_row;
28
29 # Date run label
30 0 $self->begin_row
31 ->check_label('Date run:')
32 ->end_row;
33
34 # Date run
35 0 $self->begin_row
36 ->check_date_run
37 ->end_row;
38
39 # Data column labels
40 0 $self->begin_row
41 ->check_blank
42 ->check_label('Publisher', qr/^(?i)pub/)
43 ->check_label('Platform', qr/^(?i)plat/)
44 ->check_blank
45 ->check_period_labels
46 ->check_label('YTD Total')
47 ->end_row;
48 }
49  
50 0 ▶sub process_record {
Subroutine process_record: not called CC=3 SCAR=24.8
Pod undocumented
51 0 my ($self) = @_;
52
53 # First row -- searches run
54 0 $self->begin_row;
55 0 ▶ return if $self->_eof;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_eof 0 0 0
56 0 $self->check_title(NOT_BLANK)
57 ->check_publisher(MAY_BE_BLANK)
58 ->check_platform(NOT_BLANK)
59 ->check_label('Searches run')
60 ->check_count_by_periods(SEARCHES)
61 ->check_ytd_total
62 ->end_row;
63
64 # Fields that must be the same in the second row as in the first
65 0 my $record = $self->{'record'};
66 0 my ($title, $publisher, $platform) = @$record{qw(title publisher platform)};
67
68 # Second row -- sessions
69 0 $self->begin_row
70 ->check_title(EXACT_MATCH, $title)
71 ->check_publisher(EXACT_MATCH, $publisher)
72 ->check_platform(EXACT_MATCH, $platform)
73 ->check_label('Sessions')
74 ->check_count_by_periods(SESSIONS)
75 ->check_ytd_total
76 ->end_row;
77
78 0 ▶ $self->blank_row unless $self->_eof;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_eof 0 0 0
79 }
80  
81 1 1;
82  
83 =pod
84  
85 =head1 NAME
86  
87 Biblio::COUNTER::Report::Release2::DatabaseReport1 - a DB1 (R2) COUNTER report
88  
89 =head1 SYNOPSIS
90  
91 $report = Biblio::COUNTER::Report::Release2::DatabaseReport1->new(
92 'file' => $file,
93 );
94 $report->process;
95  
96 =cut
« COUNTER/Processor/Simple.pm ↑ Summary COUNTER/Report/Release2/DatabaseReport3.pm »