Summarize/Filters.pm

filter: Statementstmt 76.1% 16 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 3 totaltotal 66.6% 20 / 30 CC 1 SCAR 2.9
CC
1
Cov
76%
easyhtml
2.0
email
2.0
BEGIN
1.0
CRAP 1.3
« Summarize.pm ↑ Summary
1 package Lingua::EN::Summarize::Filters;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 0 ▶sub easyhtml {
Subroutine easyhtml: not called CC=1 SCAR=6.9
Pod undocumented
8 0 my $text = shift;
9  
10 # A very simple-minded HTML stripper.
11 0 $text =~ s/<(?:[^>\'\"]*|([\'\"]).*?\1)*>//gs;
12 0 return $text;
13 }
14  
15  
16 1 ▶sub html {
Subroutine html: called CC=1 SCAR=0.0
Pod undocumented
17 1 my $html = shift;
18 1 my $text = '';
19  
20 # closure!
21 1 ▶ my $callback = sub { $text .= shift };
Subroutine __ANON__: called CC=1 SCAR=0.0
22  
23 1 require HTML::Parser;
24 1 my $parser = HTML::Parser->new( api_version => 3,
25 text_h => [ $callback, "dtext" ] );
26 1 $parser->parse( $html );
27 1 $parser->eof();
28  
29 1 return $text;
30 }
31  
32  
33 0 ▶sub email {
Subroutine email: not called CC=1 SCAR=6.9
Pod undocumented
34 0 my $text = shift;
35  
36 # magic goes here
37 0 croak "Not implemented yet FIXME FIXME FIXME";
38 }
39  
40  
41  
42 1 1;
43 __END__
« Summarize.pm ↑ Summary