blib/lib/App/RecordStream/Operation/fromxferlog.pm

filter: Statementstmt 55.5% 15 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 54.0% 20 / 37 CC 2 SCAR 8.5
CC
2
Cov
52%
accept_line
6.0
init
2.0
usage
2.0
CRAP 2.3
« blib/lib/App/RecordStream/Operation/tocsv.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/ValuesToKeys.pm »
1 package App::RecordStream::Operation::fromxferlog;
2  
3 our $VERSION = "4.0.23";
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use base qw(App::RecordStream::Operation);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use App::RecordStream::Record;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use App::RecordStream::OptionalRequire qw(Net::FTPServer::XferLog);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 App::RecordStream::OptionalRequire::require_done();
13  
14 sub init {
15 0 ▶ my $this = shift;
Subroutine init: not called CC=1 SCAR=6.9
16 0 my $args = shift;
17  
18 0 my $spec = {};
19  
20 0 $this->parse_options($args, $spec);
21 }
22  
23 sub accept_line {
24 0 ▶ my $this = shift;
Subroutine accept_line: not called CC=2 SCAR=17.9
25 0 my $line = shift;
26  
27 0 ▶ if (my $hash = Net::FTPServer::XferLog->parse_line($line)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $hash = "Net::FTPServer::XferLog"->parse_line($line)) 0 0 0
28 0 my $record = App::RecordStream::Record->new($hash);
29 0 $this->push_record($record);
30 }
31  
32 0 return 1;
33 }
34  
35 sub usage {
36 0 ▶ my $this = shift;
Subroutine usage: not called CC=1 SCAR=6.9
37  
38 0 return <<USAGE;
39 Usage: recs-fromxferlog <args>
40 __FORMAT_TEXT__
41 Each line of input (or lines of <files>) is parse by Net::FTPServer::XferLog to produce an output record.
42 __FORMAT_TEXT__
43  
44 Examples:
45 Get records from typical xferlog
46 recs-fromxferlog < /var/log/xferlog
47 USAGE
48 }
49  
50 1;
« blib/lib/App/RecordStream/Operation/tocsv.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/ValuesToKeys.pm »