CSC/ECE 517 Spring 2020 - E2006. Refactor Tree Display Controller: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Temporary setup of wiki page. Names and project problem statement included)
 
Line 13: Line 13:
E2006. Refactor tree_display_controller.rb
E2006. Refactor tree_display_controller.rb
===Background===
===Background===
To be completed
The tree_display_controller is responsible for rendering hierarchical lists in the instructor user interface.  Here is a sample instructor homepage:


====Issue 1====
[[File:Example_instructor_homepage.JPG]]
To be completed
====Issue 2====
To be completed
====Issue 3====
To be completed


===Motivation===
You will see here that assignments are nested within courses.  This means that the node for an assignment has a parent_id that points to a node for a course. Similarly, listings of questionnaires are hierarchical:


To be completed
[[File:Questionnaires_listing.JPG]]
 
The various rubrics, as well as surveys, are types of questionnaires. So the parent_id of a particular rubric will be the type of rubric (e.g., teammate review) that it is.
 
The tree_display_controller is 379 lines long, and contains 45 methods.  Many of those methods have similar names, yet there may be good reasons for having separate methods.  Look over how these methods are used, and then decide.  Then analyze the rest of the methods and try to find ways to save code and avoid DRY issues.  Even if you cannot find a way to improve a method, you should be able to come up with a 1-line or 2-line comment explaining what that method does.
 
===Issues===
 
From the problem background, we have derived three main issues to focus on in the tree display controller:
* Remove unnecessary methods - Search the 45 methods defined in the controller to see where and why they are called. Remove outdated and unused methods, and see where it is fit to merge or replace methods.
* Save code and avoid DRY issues - In addition to removing unnecessary methods, code should be reduced wherever possible to make the controller smaller an easier to read.
* Improve understanding - For all necessary, complex methods in the controller, comments should be added to improve understanding of what methods do. This way, future reviewers won't have to search for implementations to understand the functionality when working on other issues.


==Current Implementation==
==Current Implementation==

Revision as of 18:12, 20 March 2020

E2006. Refactor tree_display_controller.rb

About Expertiza

To be completed.

Project Description

Problem Statement

E2006. Refactor tree_display_controller.rb

Background

The tree_display_controller is responsible for rendering hierarchical lists in the instructor user interface. Here is a sample instructor homepage:

You will see here that assignments are nested within courses. This means that the node for an assignment has a parent_id that points to a node for a course. Similarly, listings of questionnaires are hierarchical:

The various rubrics, as well as surveys, are types of questionnaires. So the parent_id of a particular rubric will be the type of rubric (e.g., teammate review) that it is.

The tree_display_controller is 379 lines long, and contains 45 methods. Many of those methods have similar names, yet there may be good reasons for having separate methods. Look over how these methods are used, and then decide. Then analyze the rest of the methods and try to find ways to save code and avoid DRY issues. Even if you cannot find a way to improve a method, you should be able to come up with a 1-line or 2-line comment explaining what that method does.

Issues

From the problem background, we have derived three main issues to focus on in the tree display controller:

  • Remove unnecessary methods - Search the 45 methods defined in the controller to see where and why they are called. Remove outdated and unused methods, and see where it is fit to merge or replace methods.
  • Save code and avoid DRY issues - In addition to removing unnecessary methods, code should be reduced wherever possible to make the controller smaller an easier to read.
  • Improve understanding - For all necessary, complex methods in the controller, comments should be added to improve understanding of what methods do. This way, future reviewers won't have to search for implementations to understand the functionality when working on other issues.

Current Implementation

To be completed. (Repeat issues above and how they are currently being dealt with if they have a current solution).

Proposed Implementation

Files modified

To be completed.

Test Plan

To be completed.

Code Coverage

To be completed.

Team Information

Brooks Anderson

Rick Holloway

PJ Loheide

Mentor: Dr. Edward Gehringer

References

To be completed.