| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if(defined $hash->{$_} and defined $self->{$_}){ | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $hash->{$_} and defined $self->{$_}
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->{$_}
| |||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if($hash->{$_} ne $self->{$_}){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 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->{$_}
MC/DC0%0/2
defined $hash->{$_} || defined $self->{$_}
defined $hash->{$_}
defined $self->{$_}
Truth table0%0/3
A || B
A= defined $hash->{$_}B= defined $self->{$_}
| |||||||||||||||||||||||||||||||||
| 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; | |||||||||||||||||||||||||||||||