| Conditions | 1 |
| Paths | 1 |
| Total Lines | 54 |
| Code Lines | 48 |
| 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 |
||
| 18 | public function buildSettings(AbstractSettingsBuilder $builder): void |
||
| 19 | { |
||
| 20 | $builder->setDefaults([ |
||
| 21 | 'gradebook_enable' => 'true', |
||
| 22 | 'gradebook_score_display_custom' => 'false', |
||
| 23 | 'gradebook_score_display_colorsplit' => '50', |
||
| 24 | 'gradebook_score_display_upperlimit' => 'false', |
||
| 25 | 'gradebook_number_decimals' => '0', |
||
| 26 | 'teachers_can_change_score_settings' => 'true', |
||
| 27 | 'teachers_can_change_grade_model_settings' => 'true', |
||
| 28 | 'gradebook_enable_grade_model' => 'false', |
||
| 29 | 'gradebook_default_weight' => '100', |
||
| 30 | 'gradebook_locking_enabled' => 'false', |
||
| 31 | 'gradebook_default_grade_model_id' => '', |
||
| 32 | 'my_display_coloring' => 'false', |
||
| 33 | 'student_publication_to_take_in_gradebook' => 'first', |
||
| 34 | 'gradebook_detailed_admin_view' => 'false', |
||
| 35 | 'openbadges_backpack' => 'https://backpack.openbadges.org/', |
||
| 36 | 'hide_certificate_export_link' => 'false', |
||
| 37 | 'add_gradebook_certificates_cron_task_enabled' => 'false', |
||
| 38 | 'certificate_filter_by_official_code' => 'false', |
||
| 39 | 'hide_certificate_export_link_students' => 'false', |
||
| 40 | 'gradebook_hide_graph' => 'false', |
||
| 41 | 'gradebook_hide_pdf_report_button' => 'false', |
||
| 42 | 'hide_gradebook_percentage_user_result' => 'true', |
||
| 43 | 'gradebook_use_exercise_score_settings_in_categories' => 'true', |
||
| 44 | 'gradebook_use_apcu_cache' => 'true', |
||
| 45 | 'gradebook_report_score_style' => '1', |
||
| 46 | 'gradebook_score_display_custom_standalone' => 'false', |
||
| 47 | 'gradebook_use_exercise_score_settings_in_total' => 'false', |
||
| 48 | 'gradebook_dependency' => 'false', |
||
| 49 | 'gradebook_dependency_mandatory_courses' => '', |
||
| 50 | 'gradebook_badge_sidebar' => '', |
||
| 51 | 'gradebook_multiple_evaluation_attempts' => 'false', |
||
| 52 | 'allow_gradebook_stats' => 'false', |
||
| 53 | 'gradebook_flatview_extrafields_columns' => '', |
||
| 54 | 'gradebook_pdf_export_settings' => '', |
||
| 55 | 'allow_gradebook_comments' => 'false', |
||
| 56 | 'gradebook_display_extra_stats' => '', |
||
| 57 | 'gradebook_hide_table' => 'false', |
||
| 58 | 'gradebook_hide_link_to_item_for_student' => 'false', |
||
| 59 | 'gradebook_enable_subcategory_skills_independant_assignement' => 'false', |
||
| 60 | ]); |
||
| 61 | |||
| 62 | $allowedTypes = [ |
||
| 63 | 'gradebook_enable' => ['string'], |
||
| 64 | 'gradebook_number_decimals' => ['string'], |
||
| 65 | 'gradebook_default_weight' => ['string'], |
||
| 66 | 'student_publication_to_take_in_gradebook' => ['string'], |
||
| 67 | 'gradebook_detailed_admin_view' => ['string'], |
||
| 68 | 'certificate_filter_by_official_code' => ['string'], |
||
| 69 | ]; |
||
| 70 | |||
| 71 | $this->setMultipleAllowedTypes($allowedTypes, $builder); |
||
| 72 | } |
||
| 124 |