Webqq/Friend.pm

filter: Statementstmt 26.4% 9 / 34 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 25.0% 2 / 8 Podpod 0.0% 0 / 5 totaltotal 15.9% 11 / 69 CC 10 SCAR 35.8
CC
10
Cov
17%
update
72.0
__ANON__
6.0
displayname
6.0
CRAP 35.8
« Webqq/Plugin.pm ↑ Summary Webqq/Group/Member.pm »
1 package Mojo::Webqq::Friend;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Mojo::Webqq::Base 'Mojo::Webqq::Model::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 has [qw(
5 flag
6 id
7 category
8 name
9 face
10 markname
11 is_vip
12 vip_level
13 state
14 client_type
15 _flag
16 )];
17 0 ▶has uid => sub{
Subroutine __ANON__: not called CC=2 SCAR=17.9
18 0 my $self = shift;
19 0 ▶ return $self->{uid} if defined $self->{uid};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"uid"} 0 0 0
20 0 return $self->client->get_qq_from_id($self->id);
21 1 };
22 0 ▶sub qq {$_[0]->uid}
Subroutine qq: not called CC=1 SCAR=6.9
Pod undocumented
23 0 ▶sub nick {$_[0]->name}
Subroutine nick: not called CC=1 SCAR=6.9
Pod undocumented
24 0 ▶sub displayname {
Subroutine displayname: not called CC=2 SCAR=17.9
Pod undocumented
25 0 my $self = shift;
26 0 ▶ return defined $self->markname?$self->markname:$self->name;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->markname ? : 0 0 0
27 }
28 0 ▶sub update{
Subroutine update: not called CC=8 SCAR=42.8
Pod undocumented
29 0 my $self = shift;
30 0 my $hash = shift;
31 0 for(grep {substr($_,0,1) ne "_"} keys %$hash){
32 0 ▶ if(exists $hash->{$_}){
Branch: 1 branch
BranchTrueFalseTotal
if (exists $hash->{$_}) 0 0 0
33 0 ▶ if(defined $hash->{$_} and defined $self->{$_}){
Branch: 2 branches
BranchTrueFalseTotal
if (defined $hash->{$_} and defined $self->{$_}) { } 0 0 0
elsif (not !(defined $hash->{$_} || defined $self->{$_})) { } 0 0 0
Condition0%0/3
defined $hash->{$_} and defined $self->{$_}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $hash->{$_} and defined $self->{$_}
defined $hash->{$_} defined $self->{$_}
Truth table0%0/3
A and B
A= defined $hash->{$_}B= defined $self->{$_}
ABresult
0X0
100
111
34 0 ▶ if($hash->{$_} ne $self->{$_}){
Branch: 1 branch
BranchTrueFalseTotal
if ($hash->{$_} ne $self->{$_}) 0 0 0
35 0 my $old_property = $self->{$_};
36 0 my $new_property = $hash->{$_};
37 0 $self->{$_} = $hash->{$_};
38 0 $self->client->emit("friend_property_change"=>$self,$_,$old_property,$new_property);
39 }
40 }
41 ▶ elsif( ! (!defined $hash->{$_} and !defined $self->{$_}) ){
Condition0%0/3
defined $hash->{$_} || defined $self->{$_}
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $hash->{$_} || defined $self->{$_}
defined $hash->{$_} defined $self->{$_}
Truth table0%0/3
A || B
A= defined $hash->{$_}B= defined $self->{$_}
ABresult
1X1
011
000
42 0 my $old_property = $self->{$_};
43 0 my $new_property = $hash->{$_};
44 0 $self->{$_} = $hash->{$_};
45 0 $self->client->emit("friend_property_change"=>$self,$_,$old_property,$new_property);
46 }
47 }
48 }
49 0 $self;
50 }
51  
52 0 ▶sub send {
Subroutine send: not called CC=1 SCAR=6.9
Pod undocumented
53 0 my $self = shift;
54 0 $self->client->send_friend_message($self,@_);
55 }
56  
57 1 1;
« Webqq/Plugin.pm ↑ Summary Webqq/Group/Member.pm »