CSC/ECE 517 Spring 2020 - Project E2008. Refactor summary helper.rb

From Expertiza_Wiki
Jump to navigation Jump to search

This page provides a description of the Expertiza based OSS project.


About Expertiza

Expertiza is a web application developed using Ruby on Rails Framework whose creation and maintenance are taken care of by students as well as the faculty of NCSU. Its code is available on Github Expertiza on GitHub. Expertiza allows the instructor to create and edit new as well as existing assignments. This also includes creating a wide range of topics under each assignment that students can sign up for. They can also publish surveys and reviews, view statistical results, set deadlines for assignments and make announcements. It provides a platform for students to signup for topics, form teams, view and submit assignments and give peer reviews and feedback.

Problem Statement

Background: In Expertiza students can review each other’s projects and even each other as teammates. Students can view their project scores and instructors can view student's teammate review scores on the view scores page. This helper file aids in calculating these scores and rendering the results on the view scores section of an assignment. Summary helper is a helper module that consists of methods used to calculate scores for these reviews. This is for the use of instructors.

Requirement: E2008 is an Expertiza OSS project which deals basically with refactoring app/helpers/summary_helper.rb to reduce the code climate issues such as

Issues found

The following are issues which were found in the code:

  • Assignment Branch Condition
Method ABC Size
summarize_reviews_by_reviewee 44.61
summarize_reviews_by_criterion 42.34
summarize_reviews_by_reviewees 89.93
get_questions_by_assignment 16.43
calculate_avg_score_by_round 18.57


  • Cognitive Complexity
Method Cognitive Complexity
summarize_reviews_by_criterion 16
summarize_reviews_by_reviewees 17
get_questions_by_assignment 11
break_up_comments_to_sentences 6


  • Method/line too long
Method/Line too long Comments
Method: summarize_reviews_by_reviewees Lines of Code:39
Method: summarize_reviews_by_criterion Lines of Code:27
Line: 145 self.avg_scores_by_round[reviewee.name][round] too long (162/160)
  • Unused variables / access modifiers:
Vaiable/Access Modifier Comments
Variable: summary Method: summarize_sentences
Variable: included_question_counter Method: summarize_reviews_by_reviewee
Access Modifier: module_function Class: Summary

Solution Proposed

Future improvement

Contributors