| Conditions | 1 |
| Paths | 1 |
| Total Lines | 51 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
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:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 11 | public function callback(){ |
||
| 12 | |||
| 13 | /** Total number of students by institutions |
||
| 14 | * In Grafana query to get total students count |
||
| 15 | * `select total from students_count_view where institution_id = $id` |
||
| 16 | * `select male from students_count_view where institution_id = $id` |
||
| 17 | * `select female from students_count_view where institution_id = $id` |
||
| 18 | **/ |
||
| 19 | DashboardViews::createOrUpdateStudentCount(); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Student list by institution |
||
| 23 | * select * from students_list_view where institution_id = $id |
||
| 24 | */ |
||
| 25 | DashboardViews::createOrUpdateStudentList(); |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Bulkupload files list |
||
| 29 | * select * from upload_list_view where institution_id = $id |
||
| 30 | */ |
||
| 31 | DashboardViews::createOrUpdateUploadList(); |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Bulkupload counts |
||
| 35 | * select * from upload_count_view where institution_id = $id |
||
| 36 | */ |
||
| 37 | DashboardViews::createOrUpdateUploadCount(); |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Institution Information |
||
| 41 | * select * from institution_info_view where institution_id = $id |
||
| 42 | */ |
||
| 43 | DashboardViews::createOrUpdateInstitutionInfo(); |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Students count by Grade |
||
| 47 | * select * from students_count_by_grade_view where institution_id = $id |
||
| 48 | */ |
||
| 49 | DashboardViews::createOrUpdateStudentsCountByGrade(); |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Students count by BMI |
||
| 53 | * select * from students_count_by_bmi_view where institution_id = $id |
||
| 54 | */ |
||
| 55 | DashboardViews::createOrUpdateStudentCountByBMI(); |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Students count by Class table |
||
| 59 | * select * from student_count_by_class_view where institution_id = $id |
||
| 60 | */ |
||
| 61 | DashboardViews::createOrUpdateStudentCountByClass(); |
||
| 62 | } |
||
| 65 |