| 1 | package Data::OpenGraph::Parser; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use HTML::Parser; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 6 | 2 | my $class = shift; | |||||||||||||||||||||||||||
| 7 | my $parser = HTML::Parser->new( | ||||||||||||||||||||||||||||
| 8 | api_version => 3, | ||||||||||||||||||||||||||||
| 9 | 2 | ▶ | start_h => [ sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=5 SCAR=17.5
| |||||||||||||||||||||||||||||
| 10 | 2 | my ($self, $tag, $attr) = @_; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | return unless $tag eq 'meta'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | my $prop = $attr->{property}; | |||||||||||||||||||||||||||
| 15 | 2 | my $content = $attr->{content}; | |||||||||||||||||||||||||||
| 16 | 2 | ▶ | return unless $prop && $content; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$prop and $content
MC/DC0%0/2
$prop and $content
$prop
$content
Truth table33%1/3
A and B
A= $propB= $content
| |||||||||||||||||||||||||||||
| 17 | 2 | ▶ | return unless $prop =~ s/^og://; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | $self->{properties}->{$prop} = $content; | |||||||||||||||||||||||||||
| 20 | 2 | }, "self, tagname, attr" ], | |||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||
| 22 | 2 | return bless { parser => $parser }, $class; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub parse_string { | ||||||||||||||||||||||||||
|
Subroutine
parse_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 2 | my ($self, $string) = @_; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 2 | my %properties; | |||||||||||||||||||||||||||
| 29 | 2 | my $parser = $self->{parser}; | |||||||||||||||||||||||||||
| 30 | 2 | local $parser->{properties} = \%properties; | |||||||||||||||||||||||||||
| 31 | 2 | $parser->parse($string); | |||||||||||||||||||||||||||
| 32 | 2 | $parser->eof; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 2 | return \%properties; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1 | 1; | |||||||||||||||||||||||||||