| 1 | package Mojo::Webqq::Discuss::Member; | ||||||||||||||||||||||||||||||||
| 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 | name | ||||||||||||||||||||||||||||||||
| 6 | id | ||||||||||||||||||||||||||||||||
| 7 | state | ||||||||||||||||||||||||||||||||
| 8 | client_type | ||||||||||||||||||||||||||||||||
| 9 | _discuss_id | ||||||||||||||||||||||||||||||||
| 10 | _flag | ||||||||||||||||||||||||||||||||
| 11 | )]; | ||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | has uid => sub{ | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 14 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | return $self->{uid} if defined $self->{uid}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 16 | 0 | return $self->client->get_qq_from_id($self->id); | |||||||||||||||||||||||||||||||
| 17 | 1 | }; | |||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub qq {$_[0]->uid} | ||||||||||||||||||||||||||||||
|
Subroutine
qq: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub nick {$_[0]->name} | ||||||||||||||||||||||||||||||
|
Subroutine
nick: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||
| 21 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | if($Mojo::Webqq::Discuss::Member::AUTOLOAD =~ /.*::d(.*)/){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 23 | 0 | my $attr = $1; | |||||||||||||||||||||||||||||||
| 24 | 0 | $self->group->$attr(@_); | |||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | 0 | else{die("undefined subroutine $Mojo::Webqq::Discuss::Member::AUTOLOAD");} | |||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub displayname { | ||||||||||||||||||||||||||||||
|
Subroutine
displayname: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 29 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 30 | 0 | my $f = $self->client->search_friend(id=>$self->id); | |||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | if(defined $f){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | return $f->markname // $self->name; | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$f->markname // $self->name
MC/DC0%0/2
$f->markname // $self->name
$f->markname
$self->name
Truth table0%0/3
A // B
A= $f->marknameB= $self->name
| |||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | else{ | ||||||||||||||||||||||||||||||||
| 35 | 0 | return $self->name; | |||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub update{ | ||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 39 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 40 | 0 | my $hash = shift; | |||||||||||||||||||||||||||||||
| 41 | 0 | for(grep {substr($_,0,1) ne "_"} keys %$hash){ | |||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if(exists $hash->{$_}){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 43 | 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->{$_}
| |||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | if($hash->{$_} ne $self->{$_}){ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 45 | 0 | my $old_property = $self->{$_}; | |||||||||||||||||||||||||||||||
| 46 | 0 | my $new_property = $hash->{$_}; | |||||||||||||||||||||||||||||||
| 47 | 0 | $self->{$_} = $hash->{$_}; | |||||||||||||||||||||||||||||||
| 48 | 0 | $self->client->emit("discuss_member_property_change"=>$self,$_,$old_property,$new_property); | |||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||
| 51 | ▶ | 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->{$_}
| |||||||||||||||||||||||||||||||||
| 52 | 0 | my $old_property = $self->{$_}; | |||||||||||||||||||||||||||||||
| 53 | 0 | my $new_property = $hash->{$_}; | |||||||||||||||||||||||||||||||
| 54 | 0 | $self->{$_} = $hash->{$_}; | |||||||||||||||||||||||||||||||
| 55 | 0 | $self->client->emit("discuss_member_property_change"=>$self,$_,$old_property,$new_property); | |||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||
| 59 | 0 | $self; | |||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | sub send { | ||||||||||||||||||||||||||||||
|
Subroutine
send: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 63 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 64 | 0 | $self->client->send_sess_message($self,@_); | |||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | sub discuss { | ||||||||||||||||||||||||||||||
|
Subroutine
discuss: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 68 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 69 | 0 | return scalar $self->client->search_discuss(id=>$self->_discuss_id); | |||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | 1 | 1; | |||||||||||||||||||||||||||||||