| 1 | package Mail::Stats::Parser; | ||||||||||||||||||||||
| 2 | |||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 4 | 1 | ▶ | use Mail::Stats::Record; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 5 | |||||||||||||||||||||||
| 6 | 1 | ▶ | use vars qw($Start_Header $Status_Header $Ignore_Header $End_Header); | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 7 | |||||||||||||||||||||||
| 8 | 1 | $Start_Header = 'From \S+\s+\w\w\w \w\w\w\s+\d+ \d+:\d+:\d+ \d+'; | |||||||||||||||||||||
| 9 | 1 | $Status_Header = '(X-)?Status:'; | |||||||||||||||||||||
| 10 | 1 | $Ignore_Header = 'Subject: DON\'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA'; | |||||||||||||||||||||
| 11 | 1 | $End_Header = '\s*'; | |||||||||||||||||||||
| 12 | |||||||||||||||||||||||
| 13 | 0 | ▶ | sub parse { | ||||||||||||||||||||
|
Subroutine
parse: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||
| 14 | 0 | my $fh = shift; | |||||||||||||||||||||
| 15 | |||||||||||||||||||||||
| 16 | 0 | my $mail = new Mail::Stats::Record(); | |||||||||||||||||||||
| 17 | |||||||||||||||||||||||
| 18 | 0 | my $header = 0; | |||||||||||||||||||||
| 19 | |||||||||||||||||||||||
| 20 | 0 | ▶ | while(<$fh>) { | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 21 | 0 | ▶ | if(/^From \S+\s+\w+ \w+\s+\d+ \d+:\d+:\d+ \d+/) { | ||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||
| 22 | 0 | $header = 1; | |||||||||||||||||||||
| 23 | 0 | $mail->{MESSAGES}++; | |||||||||||||||||||||
| 24 | ▶ | } elsif ($header && /^$Status_Header/og) { | |||||||||||||||||||||
|
Condition0%0/3
$header and /^$Mail::Stats::Parser::Status_Header/go
MC/DC0%0/2
$header and /^$Mail::Stats::Parser::Status_Header/go
$header
/^$Mail::Stats::Parser::Status_Header/go
Truth table0%0/3
A and B
A= $headerB= /^$Mail::Stats::Parser::Status_Header/go
| |||||||||||||||||||||||
| 25 | 0 | ▶ | while(/(\w)/g) { | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 26 | 0 | $mail->{STATUS}->{$1}++; | |||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||
| 28 | ▶ | } elsif ($header && /^$Ignore_Header/o) { | |||||||||||||||||||||
|
Condition0%0/3
$header and /^$Mail::Stats::Parser::Ignore_Header/o
MC/DC0%0/2
$header and /^$Mail::Stats::Parser::Ignore_Header/o
$header
/^$Mail::Stats::Parser::Ignore_Header/o
Truth table0%0/3
A and B
A= $headerB= /^$Mail::Stats::Parser::Ignore_Header/o
| |||||||||||||||||||||||
| 29 | 0 | $mail->{MESSAGES}--; | |||||||||||||||||||||
| 30 | 0 | $header = 0; | |||||||||||||||||||||
| 31 | ▶ | } elsif ($header && /^$End_Header$/o) { | |||||||||||||||||||||
|
Condition0%0/3
$header and /^$Mail::Stats::Parser::End_Header$/o
MC/DC0%0/2
$header and /^$Mail::Stats::Parser::End_Header$/o
$header
/^$Mail::Stats::Parser::End_Header$/o
Truth table0%0/3
A and B
A= $headerB= /^$Mail::Stats::Parser::End_Header$/o
| |||||||||||||||||||||||
| 32 | 0 | $header = 0; | |||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||
| 35 | |||||||||||||||||||||||
| 36 | 0 | return $mail; | |||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||
| 38 | |||||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||||