Passed
Push — master ( d3fd5d...81f334 )
by Mihail
03:51
created

Profile::actionListmessagedialog()   C

Complexity

Conditions 13
Paths 85

Size

Total Lines 70
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 13
eloc 40
nc 85
nop 2
dl 0
loc 70
rs 5.6314
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Apps\Controller\Api;
4
5
use Extend\Core\Arch\ApiController;
6
7
/**
8
 * Class Profile. Api controller provide ajax/json for user profile features
9
 * @package Apps\Controller\Api
10
 */
11
class Profile extends ApiController
12
{
13
    const ITEM_PER_PAGE = 10;
14
    const ANSWER_DELAY = 60; // in seconds
15
16
    const MSG_USER_LIST = 10;
17
    const MSG_TEXT_LIST = 20;
18
19
    // include actions from traits
20
    use Profile\ActionWallAnswerCount {
21
        wallAnswerCount as actionWallanswercount;
22
    }
23
24
    use Profile\ActionShowWallAnswers {
25
        showWallAnswers as actionShowwallanswers;
26
    }
27
28
    use Profile\ActionSendWallAnswer {
29
        sendWallAnswer as actionSendwallanswer;
30
    }
31
32
    use Profile\ActionDeleteAnswerOwner {
33
        deleteAnswerOwner as actionDeleteanswerowner;
34
    }
35
36
    use Profile\ActionListMessageDialog {
37
        listMessageDialog as actionListmessagedialog;
38
    }
39
40
    use Profile\ActionNotifications {
41
        notifications as actionNotifications;
42
    }
43
44
    use Profile\ActionMessageList {
45
        messageList as actionMessageList;
46
    }
47
48
    use Profile\ActionMessageSend {
49
        messageSend as actionMessagesend;
50
    }
51
52
    use Profile\ActionChangeRating {
53
        changeRating as actionChangerating;
54
    }
55
}
56