CSC/ECE 517 Spring 2024 - E2406 Refactor review mapping helper.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 70: Line 70:
We have been assigned below-cited changes to do after project 3
We have been assigned below-cited changes to do after project 3


===1. Refactoring get_awarded_review_score Method:<br/>===
===1. Refactoring get_awarded_review_score Method:===<br/>
- Standardize the score-calculation logic to ensure consistency and readability.<br/>
- Standardize the score-calculation logic to ensure consistency and readability.<br/>
- Break down complex calculations into smaller, more understandable components.<br/>
- Break down complex calculations into smaller, more understandable components.<br/>
- Improve method documentation and clarity to enhance understanding.<br/>
- Improve method documentation and clarity to enhance understanding.<br/>


===2. Generalizing sort_reviewer_by_review_volume_desc:<br/>===
===2. Generalizing sort_reviewer_by_review_volume_desc:===<br/>
- Modify the method to accept flexible sorting metrics, enabling customization based on various criteria.<br/>
- Modify the method to accept flexible sorting metrics, enabling customization based on various criteria.<br/>
- Update method documentation to reflect the changes and provide usage guidelines.<br/>
- Update method documentation to reflect the changes and provide usage guidelines.<br/>


===3. Code Organization Enhancements:<br/>===
===3. Code Organization Enhancements:===<br/>
- Extract chart-generating methods into separate modules or classes for better organization and reusability.<br/>
- Extract chart-generating methods into separate modules or classes for better organization and reusability.<br/>
- Evaluate the necessity of list_review_submissions method based on insights from the Expertiza wiki and refactor accordingly.<br/>
- Evaluate the necessity of list_review_submissions method based on insights from the Expertiza wiki and refactor accordingly.<br/>


===4. Documentation and Clarity Improvements:<br/>===
===4. Documentation and Clarity Improvements:===<br/>
-Review methods related to feedback_response_maps and add comments or refactor small classes to enhance clarity and documentation.<br/>
-Review methods related to feedback_response_maps and add comments or refactor small classes to enhance clarity and documentation.<br/>
-Ensure consistent naming conventions and adherence to coding standards throughout the codebase.<br/>
-Ensure consistent naming conventions and adherence to coding standards throughout the codebase.<br/>

Revision as of 23:10, 8 April 2024

Team

Mentor

  • Ananya Mantravadi (amantra)

Team Members

  • Ravi Ghevariya (rghevar)
  • Manan Patel (mrpatel8)
  • Kanishk Harde (knharde)

Relevant Links

Expertiza Background

Expertiza is a Ruby on Rails framework-based open-source web application. It is kept up by NC State University employees and students. With the help of this program, instructors can fully manage the assignments and responsibilities assigned in their classes. Expertiza provides many strong features, such as subject addition, group creation, and peer review administration. It is a flexible platform that can manage many kinds of tasks. Users can consult the Expertiza wiki to get more in-depth details about the many capabilities that Expertiza offers.

About Helper

The Ruby on Rails review_mapping_helper module offers a number of helper methods to make the peer review process easier in assignments. It has the capacity to calculate review scores, manage submission statuses, generate review reports, and visualize review metrics; however, it needs to be refactored in order to make the code more readable and maintainable.

Problem Statement

The existing codebase derived from E2301 suffers from lack of clarity, violating the Expert pattern, and inefficient methods, hindering code understandability and maintainability. Key issues include convoluted data handling in views, unclear color-coding methods, and inefficient sorting functions. Additionally, redundant methods and unclear feedback_response_maps further obscure the code's purpose.

Tasks

- Refactor get_data_for_review_report to use partials for clearer code in views/reports.
- Refactor color-related methods for clarity and consistency, using American spelling.
- Rename methods starting with "get" to adhere to Ruby conventions.
- Update get_awarded_review_score to utilize standardized score-calculation code.
- Generalize sort_reviewer_by_review_volume_desc for sorting by various metrics.
- Extract chart-generating methods into a separate file for better organization.
- Evaluate necessity of list_review_submissions method based on Expertiza wiki.
- Review and clarify the purpose of feedback_response_maps methods.
- Add comments or refactor small classes for clarity and documentation.

Phase 1

We have concentrated our efforts on addressing the following difficulties throughout the project's first phase:
- Refactor get_data_for_review_report to use partials for clearer code in views/reports.
- Refactor color-related methods for clarity and consistency, using American spelling.
- Rename methods starting with "get" to adhere to Ruby conventions.

Phase 2

We have planned our efforts on addressing the following difficulties throughout the project's second phase:
- Update get_awarded_review_score to utilize standardized score-calculation code.
- Generalize sort_reviewer_by_review_volume_desc for sorting by various metrics.
- Extract chart-generating methods into a separate file for better organization.
- Evaluate necessity of list_review_submissions method based on Expertiza wiki.
- Review and clarify the purpose of feedback_response_maps methods.
- Add comments or refactor small classes for clarity and documentation.

Implementation

Phase 1

Refactor the `get_data_for_review_report` method

Refactor the `color-related` methods

Rename methods starting with `get` to adhere to Ruby conventions methods

Design Pattern

The Refactoring pattern is essential to enhance code readability, maintainability, and adherence to best practices. By systematically restructuring code components, eliminating redundancies, and applying standard conventions, the Refactoring pattern ensures improved code quality and easier future modifications.

Plan of work

We began our work by examining the review_mapping_helper.rb file to understand its connection to the rest of the codebase. We then had detailed discussions with our mentor about the project's flow and structure. We organized our project requirements by difficulty levels, assigned tasks among the team, and began refactoring existing methods and creating new files as needed. We made sure to preserve the integrity of existing test cases while adding new ones where needed.

Project 4 - DESIGN DOC

We have been assigned below-cited changes to do after project 3

===1. Refactoring get_awarded_review_score Method:===
- Standardize the score-calculation logic to ensure consistency and readability.
- Break down complex calculations into smaller, more understandable components.
- Improve method documentation and clarity to enhance understanding.

===2. Generalizing sort_reviewer_by_review_volume_desc:===
- Modify the method to accept flexible sorting metrics, enabling customization based on various criteria.
- Update method documentation to reflect the changes and provide usage guidelines.

===3. Code Organization Enhancements:===
- Extract chart-generating methods into separate modules or classes for better organization and reusability.
- Evaluate the necessity of list_review_submissions method based on insights from the Expertiza wiki and refactor accordingly.

===4. Documentation and Clarity Improvements:===
-Review methods related to feedback_response_maps and add comments or refactor small classes to enhance clarity and documentation.
-Ensure consistent naming conventions and adherence to coding standards throughout the codebase.