NicoVideo/Content/Flv.pm

filter: Statementstmt 62.5% 25 / 40 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 3 totaltotal 47.0% 32 / 68 CC 8 SCAR 28.6
CC
8
Cov
47%
parse
42.0
is_economy
12.0
members
2.0
CRAP 17.5
« NicoVideo/Content/NicoAPI.pm ↑ Summary NicoVideo/UserAgent.pm »
1 package Net::NicoVideo::Content::Flv;
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 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 $VERSION = '0.28';
7  
8 1 ▶use base qw(Net::NicoVideo::Content Class::Accessor::Fast);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use CGI::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use vars qw(@Members);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 @Members = qw(
14 thread_id
15 l
16 url
17 link
18 ms
19 user_id
20 is_premium
21 nickname
22 time
23 done
24 feedrev
25 ng_rv
26 hms
27 hmsp
28 hmst
29 hmstk
30 rpu
31 );
32  
33 1 __PACKAGE__->mk_accessors(@Members);
34  
35 0 ▶sub members { # implement
Subroutine members: not called CC=1 SCAR=6.9
Pod undocumented
36 0 my @copy = @Members;
37 0 @copy;
38 }
39  
40 0 ▶sub parse { # implement
Subroutine parse: not called CC=6 SCAR=37.4
Pod undocumented
41 0 my $self = shift;
42 0 ▶ $self->load($_[0]) if( defined $_[0] );
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0] 0 0 0
43  
44 0 my $cgi = CGI::Simple->new($self->_decoded_content);
45 0 for my $name ( $cgi->param ){
46 0 ▶ $self->$name( $cgi->param($name) )
Branch: 1 branch
BranchTrueFalseTotal
if $self->can($name) 0 0 0
47 if( $self->can($name) );
48 }
49  
50 # status
51 0 my $url = $self->url;
52 0 ▶ if( defined $url and $url =~ /nicovideo\.jp/ ){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $url and $url =~ /nicovideo\.jp/) { } 0 0 0
Condition0%0/3
defined $url and $url =~ /nicovideo\.jp/
!ll&&!rl&&r
000
MC/DC0%0/2
defined $url and $url =~ /nicovideo\.jp/
defined $url $url =~ /nicovideo\.jp/
Truth table0%0/3
A and B
A= defined $urlB= $url =~ /nicovideo\.jp/
ABresult
0X0
100
111
53 0 $self->set_status_success;
54 }else{
55 0 $self->set_status_error;
56 }
57  
58 0 return $self;
59 }
60  
61 0 ▶sub is_economy {
Subroutine is_economy: not called CC=3 SCAR=24.8
Pod undocumented
62 0 my $self = shift;
63 0 ▶ my $url = $self->url or croak "url is not set, does not it fetch flv data yet?";
Branch: 1 branch
BranchTrueFalseTotal
my $url = $self->url or croak("url is not set, does not it fetch flv data yet?") 0 0 0
64 0 ▶ return $url =~ /low$/ ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$url =~ /low$/ ? : 0 0 0
65 }
66  
67  
68 1 1;
69 __END__
« NicoVideo/Content/NicoAPI.pm ↑ Summary NicoVideo/UserAgent.pm »