CSC/ECE 517 Spring 2020 - Project E2008. Refactor summary helper.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
* [http://wiki.c2.com/?AbcMetric Assignment Branch Condition]
* [http://wiki.c2.com/?AbcMetric Assignment Branch Condition]
* [http://en.wikipedia.org/wiki/Cyclomatic_complexity Cognitive Complexity]
* [http://en.wikipedia.org/wiki/Cyclomatic_complexity Cognitive Complexity]
* Method too long
* Method/line too long
* Unused variables
* Unused variables / access modifiers
 
=='''Issues found'''==
The following are issues which were found in the code:
 
* Assignment Branch Condition
** '''Method:''' summarize_reviews_by_reviewee  '''ABC Size:''' 44.61
** '''Method:''' summarize_reviews_by_criterion '''ABC Size:''' 42.34
** '''Method:''' summarize_reviews_by_reviewees '''ABC Size:''' 89.93
** '''Method:''' get_questions_by_assignment '''ABC Size:''' 16.43
** '''Method:''' calculate_avg_score_by_round '''ABC Size:''' 18.57
* Cognitive Complexity
** '''Method:''' summarize_reviews_by_reviewees  '''Cognitive Complexity:''' 17
** '''Method:''' summarize_reviews_by_criterion  '''Cognitive Complexity:''' 16
** '''Method:''' get_questions_by_assignment  '''Cognitive Complexity:''' 11
** '''Method:''' break_up_comments_to_sentences  '''Cognitive Complexity:''' 6
 
* Method/line too long
** '''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]'''
 
* Unused variables / access modifiers:
** '''Variable:''' summary  '''Method:''' summarize_sentences
** '''Variable:''' included_question_counter  '''Method:''' summarize_reviews_by_reviewee
** '''Access Modifier:''' module_function  '''Class:''' Summary


=='''Drawbacks'''==


=='''Solution Proposed'''==
=='''Solution Proposed'''==

Revision as of 10:25, 21 March 2020

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: summarize_reviews_by_reviewee ABC Size: 44.61
    • Method: summarize_reviews_by_criterion ABC Size: 42.34
    • Method: summarize_reviews_by_reviewees ABC Size: 89.93
    • Method: get_questions_by_assignment ABC Size: 16.43
    • Method: calculate_avg_score_by_round ABC Size: 18.57
  • Cognitive Complexity
    • Method: summarize_reviews_by_reviewees Cognitive Complexity: 17
    • Method: summarize_reviews_by_criterion Cognitive Complexity: 16
    • Method: get_questions_by_assignment Cognitive Complexity: 11
    • Method: break_up_comments_to_sentences Cognitive Complexity: 6
  • Method/line too long
    • 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]
  • Unused variables / access modifiers:
    • 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