CSC/ECE 517 Spring 2024 - E2406 Refactor review mapping helper.rb

From Expertiza_Wiki
Revision as of 23:04, 8 April 2024 by Rghevar (talk | contribs)
Jump to navigation Jump to search

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.