<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hrmauny</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hrmauny"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Hrmauny"/>
	<updated>2026-08-11T20:56:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152896</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152896"/>
		<updated>2023-12-09T19:06:58Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Work Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. Refactor this method to make it more readable.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. Refactor this method to make it more readable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American word color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. Refactor this method to make it more readable.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but the score calculation code is not readable. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code needs to be understood thoroughly and as stated, has to be refactored in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We will add comments as necessary once in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''This section contains combined changes of project 3 and 4'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Issue #7''': method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt;&lt;br /&gt;
'''Problem:''' The method is returning two values and the purpose for the method is ambiguous&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Break this method into two separate methods that return each of the component parts of the ambiguous return value&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; : Returned an array of two distinct values. This method was refactored into two separate methods that each return one of the values from the initial state. &amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/adityajoshi1114/expertiza/pull/16] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #9:''' Method &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; needs to be refactored&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' Post tackling of Issue 2, the name of the method was changed to &amp;lt;code&amp;gt;compute_awarded_review_score&amp;lt;/code&amp;gt; to make it more ruby like. Further on, the code which involved redundant setting of instance variables was placed inside the loop to make it more concise. The explicit check for nil or -1.0 was removed and added to the &amp;lt;code&amp;gt;instance_variable_set&amp;lt;/code&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
Before&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def compute_awarded_review_score(reviewer_id, team_id)&lt;br /&gt;
    # Storing redundantly computed value in num_rounds variable&lt;br /&gt;
    num_rounds = @assignment.num_review_rounds&lt;br /&gt;
    # Setting values of instance variables&lt;br /&gt;
    (1..num_rounds).each { |round| instance_variable_set('@score_awarded_round_' + round.to_s, '-----') }&lt;br /&gt;
    # Iterating through list&lt;br /&gt;
    (1..num_rounds).each do |round|&lt;br /&gt;
      # Changing values of instance variable based on below condition&lt;br /&gt;
      if @review_scores[reviewer_id] &amp;amp;&amp;amp; @review_scores[reviewer_id][round] &amp;amp;&amp;amp; @review_scores[reviewer_id][round][team_id] &amp;amp;&amp;amp; @review_scores[reviewer_id][round][team_id] != -1.0&lt;br /&gt;
        instance_variable_set('@score_awarded_round_' + round.to_s, @review_scores[reviewer_id][round][team_id].to_s + '%')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def compute_awarded_review_score(reviewer_id, team_id)&lt;br /&gt;
    num_rounds = @assignment.num_review_rounds&lt;br /&gt;
&lt;br /&gt;
    (1..num_rounds).each do |round|&lt;br /&gt;
      score = @review_scores &amp;amp;&amp;amp; @review_scores[reviewer_id] &amp;amp;&amp;amp; @review_scores[reviewer_id][round] &amp;amp;&amp;amp; @review_scores[reviewer_id][round][team_id]&lt;br /&gt;
      instance_variable_set(&amp;quot;@score_awarded_round_#{round}&amp;quot;, &amp;quot;#{score}%&amp;quot;) unless score.nil? || score == -1.0&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/commits/7549f7eb407f01fa7afb84ac6a2581bf36b13396 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; and relevant file and in turn made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added as suggested by test skeleton files in &amp;lt;code&amp;gt;review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; example of some of the test cases are below&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calculate_key_chart_information' do&lt;br /&gt;
   it 'should return new Hash if intervals are not empty' do&lt;br /&gt;
      intervals = [1.00, 2.00, 3.00, 4.00, 5.00, 6.00]&lt;br /&gt;
      result = helper.calculate_key_chart_information(intervals)&lt;br /&gt;
      expect(result).to be_a_kind_of(Hash)&lt;br /&gt;
      expect(result[:mean]).to eq(3.50)&lt;br /&gt;
      expect(result[:min]).to eq(1.00)&lt;br /&gt;
      expect(result[:max]).to eq(6.00)&lt;br /&gt;
      expect(result[:variance]).to eq(2.92)&lt;br /&gt;
      expect(result[:stand_dev]).to eq(1.71)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns the mean, min, max, variance, and standard deviation of the intervals' do&lt;br /&gt;
      expect(calculate_key_chart_information([10, 15, 20])).to eq(mean: 15.0, min: 10, max: 20, variance: 16.67, stand_dev: 4.08)&lt;br /&gt;
      expect(calculate_key_chart_information([5, 8, 12, 15, 20])).to eq(mean: 12.0, min: 5, max: 20, variance: 27.6, stand_dev: 5.25)&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals are empty' do&lt;br /&gt;
      it 'returns an empty hash' do&lt;br /&gt;
        # Test case 4&lt;br /&gt;
        expect(calculate_key_chart_information([])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals contain values greater than the threshold' do&lt;br /&gt;
      it 'ignores those intervals and returns an empty hash' do&lt;br /&gt;
        expect(calculate_key_chart_information([60, 45, 35])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calibration_report_css_class' do&lt;br /&gt;
    context 'when the difference is 0' do&lt;br /&gt;
      it 'returns c5 as the CSS class' do&lt;br /&gt;
        css0 = helper.calibration_report_css_class(0)&lt;br /&gt;
        expect(css0). to eq('c5')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 1' do&lt;br /&gt;
      it 'returns c4 as the CSS class' do&lt;br /&gt;
        css1 = helper.calibration_report_css_class(-1)&lt;br /&gt;
        expect(css1). to eq('c4')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 2' do&lt;br /&gt;
      it 'returns c3 as the CSS class' do&lt;br /&gt;
        css2 = helper.calibration_report_css_class(-2)&lt;br /&gt;
        expect(css2). to eq('c3')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 3' do&lt;br /&gt;
      it 'returns c2 as the CSS class' do&lt;br /&gt;
        css3 = helper.calibration_report_css_class(-3)&lt;br /&gt;
        expect(css3). to eq('c2')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is greater than 3' do&lt;br /&gt;
      it 'returns c1 as the CSS class' do&lt;br /&gt;
        css4 = helper.calibration_report_css_class(6)&lt;br /&gt;
        expect(css4). to eq('c1')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;The image below shows the test cases are passing as well as most of the code climate issues were resolved.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152520</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152520"/>
		<updated>2023-12-05T03:00:27Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''This section contains combined changes of project 3 and 4'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; and relevant file and in turn made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added as suggested by test skeleton files in &amp;lt;code&amp;gt;review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; example of some of the test cases are below&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calculate_key_chart_information' do&lt;br /&gt;
   it 'should return new Hash if intervals are not empty' do&lt;br /&gt;
      intervals = [1.00, 2.00, 3.00, 4.00, 5.00, 6.00]&lt;br /&gt;
      result = helper.calculate_key_chart_information(intervals)&lt;br /&gt;
      expect(result).to be_a_kind_of(Hash)&lt;br /&gt;
      expect(result[:mean]).to eq(3.50)&lt;br /&gt;
      expect(result[:min]).to eq(1.00)&lt;br /&gt;
      expect(result[:max]).to eq(6.00)&lt;br /&gt;
      expect(result[:variance]).to eq(2.92)&lt;br /&gt;
      expect(result[:stand_dev]).to eq(1.71)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns the mean, min, max, variance, and standard deviation of the intervals' do&lt;br /&gt;
      expect(calculate_key_chart_information([10, 15, 20])).to eq(mean: 15.0, min: 10, max: 20, variance: 16.67, stand_dev: 4.08)&lt;br /&gt;
      expect(calculate_key_chart_information([5, 8, 12, 15, 20])).to eq(mean: 12.0, min: 5, max: 20, variance: 27.6, stand_dev: 5.25)&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals are empty' do&lt;br /&gt;
      it 'returns an empty hash' do&lt;br /&gt;
        # Test case 4&lt;br /&gt;
        expect(calculate_key_chart_information([])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals contain values greater than the threshold' do&lt;br /&gt;
      it 'ignores those intervals and returns an empty hash' do&lt;br /&gt;
        expect(calculate_key_chart_information([60, 45, 35])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calibration_report_css_class' do&lt;br /&gt;
    context 'when the difference is 0' do&lt;br /&gt;
      it 'returns c5 as the CSS class' do&lt;br /&gt;
        css0 = helper.calibration_report_css_class(0)&lt;br /&gt;
        expect(css0). to eq('c5')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 1' do&lt;br /&gt;
      it 'returns c4 as the CSS class' do&lt;br /&gt;
        css1 = helper.calibration_report_css_class(-1)&lt;br /&gt;
        expect(css1). to eq('c4')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 2' do&lt;br /&gt;
      it 'returns c3 as the CSS class' do&lt;br /&gt;
        css2 = helper.calibration_report_css_class(-2)&lt;br /&gt;
        expect(css2). to eq('c3')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 3' do&lt;br /&gt;
      it 'returns c2 as the CSS class' do&lt;br /&gt;
        css3 = helper.calibration_report_css_class(-3)&lt;br /&gt;
        expect(css3). to eq('c2')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is greater than 3' do&lt;br /&gt;
      it 'returns c1 as the CSS class' do&lt;br /&gt;
        css4 = helper.calibration_report_css_class(6)&lt;br /&gt;
        expect(css4). to eq('c1')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;The image below shows the test cases are passing as well as most of the code climate issues were resolved.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152515</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152515"/>
		<updated>2023-12-05T02:59:08Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; and relevant file and in turn made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added as suggested by test skeleton files in &amp;lt;code&amp;gt;review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; example of some of the test cases are below&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calculate_key_chart_information' do&lt;br /&gt;
   it 'should return new Hash if intervals are not empty' do&lt;br /&gt;
      intervals = [1.00, 2.00, 3.00, 4.00, 5.00, 6.00]&lt;br /&gt;
      result = helper.calculate_key_chart_information(intervals)&lt;br /&gt;
      expect(result).to be_a_kind_of(Hash)&lt;br /&gt;
      expect(result[:mean]).to eq(3.50)&lt;br /&gt;
      expect(result[:min]).to eq(1.00)&lt;br /&gt;
      expect(result[:max]).to eq(6.00)&lt;br /&gt;
      expect(result[:variance]).to eq(2.92)&lt;br /&gt;
      expect(result[:stand_dev]).to eq(1.71)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns the mean, min, max, variance, and standard deviation of the intervals' do&lt;br /&gt;
      expect(calculate_key_chart_information([10, 15, 20])).to eq(mean: 15.0, min: 10, max: 20, variance: 16.67, stand_dev: 4.08)&lt;br /&gt;
      expect(calculate_key_chart_information([5, 8, 12, 15, 20])).to eq(mean: 12.0, min: 5, max: 20, variance: 27.6, stand_dev: 5.25)&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals are empty' do&lt;br /&gt;
      it 'returns an empty hash' do&lt;br /&gt;
        # Test case 4&lt;br /&gt;
        expect(calculate_key_chart_information([])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals contain values greater than the threshold' do&lt;br /&gt;
      it 'ignores those intervals and returns an empty hash' do&lt;br /&gt;
        expect(calculate_key_chart_information([60, 45, 35])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe 'test calibration_report_css_class' do&lt;br /&gt;
    context 'when the difference is 0' do&lt;br /&gt;
      it 'returns c5 as the CSS class' do&lt;br /&gt;
        css0 = helper.calibration_report_css_class(0)&lt;br /&gt;
        expect(css0). to eq('c5')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 1' do&lt;br /&gt;
      it 'returns c4 as the CSS class' do&lt;br /&gt;
        css1 = helper.calibration_report_css_class(-1)&lt;br /&gt;
        expect(css1). to eq('c4')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 2' do&lt;br /&gt;
      it 'returns c3 as the CSS class' do&lt;br /&gt;
        css2 = helper.calibration_report_css_class(-2)&lt;br /&gt;
        expect(css2). to eq('c3')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 3' do&lt;br /&gt;
      it 'returns c2 as the CSS class' do&lt;br /&gt;
        css3 = helper.calibration_report_css_class(-3)&lt;br /&gt;
        expect(css3). to eq('c2')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is greater than 3' do&lt;br /&gt;
      it 'returns c1 as the CSS class' do&lt;br /&gt;
        css4 = helper.calibration_report_css_class(6)&lt;br /&gt;
        expect(css4). to eq('c1')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;The image below shows the test cases are passing as well as most of the code climate issues were resolved.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152511</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152511"/>
		<updated>2023-12-05T02:57:46Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; and relevant file and in turn made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added as suggested by test skeleton files in &amp;lt;code&amp;gt;review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; example of some of the test cases are below&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
describe 'test calculate_key_chart_information' do&lt;br /&gt;
   it 'should return new Hash if intervals are not empty' do&lt;br /&gt;
      intervals = [1.00, 2.00, 3.00, 4.00, 5.00, 6.00]&lt;br /&gt;
      result = helper.calculate_key_chart_information(intervals)&lt;br /&gt;
      expect(result).to be_a_kind_of(Hash)&lt;br /&gt;
      expect(result[:mean]).to eq(3.50)&lt;br /&gt;
      expect(result[:min]).to eq(1.00)&lt;br /&gt;
      expect(result[:max]).to eq(6.00)&lt;br /&gt;
      expect(result[:variance]).to eq(2.92)&lt;br /&gt;
      expect(result[:stand_dev]).to eq(1.71)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns the mean, min, max, variance, and standard deviation of the intervals' do&lt;br /&gt;
      expect(calculate_key_chart_information([10, 15, 20])).to eq(mean: 15.0, min: 10, max: 20, variance: 16.67, stand_dev: 4.08)&lt;br /&gt;
      expect(calculate_key_chart_information([5, 8, 12, 15, 20])).to eq(mean: 12.0, min: 5, max: 20, variance: 27.6, stand_dev: 5.25)&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals are empty' do&lt;br /&gt;
      it 'returns an empty hash' do&lt;br /&gt;
        # Test case 4&lt;br /&gt;
        expect(calculate_key_chart_information([])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals contain values greater than the threshold' do&lt;br /&gt;
      it 'ignores those intervals and returns an empty hash' do&lt;br /&gt;
        expect(calculate_key_chart_information([60, 45, 35])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
describe 'test calibration_report_css_class' do&lt;br /&gt;
    context 'when the difference is 0' do&lt;br /&gt;
      it 'returns c5 as the CSS class' do&lt;br /&gt;
        css0 = helper.calibration_report_css_class(0)&lt;br /&gt;
        expect(css0). to eq('c5')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 1' do&lt;br /&gt;
      it 'returns c4 as the CSS class' do&lt;br /&gt;
        css1 = helper.calibration_report_css_class(-1)&lt;br /&gt;
        expect(css1). to eq('c4')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 2' do&lt;br /&gt;
      it 'returns c3 as the CSS class' do&lt;br /&gt;
        css2 = helper.calibration_report_css_class(-2)&lt;br /&gt;
        expect(css2). to eq('c3')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 3' do&lt;br /&gt;
      it 'returns c2 as the CSS class' do&lt;br /&gt;
        css3 = helper.calibration_report_css_class(-3)&lt;br /&gt;
        expect(css3). to eq('c2')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is greater than 3' do&lt;br /&gt;
      it 'returns c1 as the CSS class' do&lt;br /&gt;
        css4 = helper.calibration_report_css_class(6)&lt;br /&gt;
        expect(css4). to eq('c1')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The image below shows the test cases are passing as well as most of the code climate issues were resolved.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152455</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152455"/>
		<updated>2023-12-05T02:05:36Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #10:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; and relevant file and in turn made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added as suggested by test skeleton files in &amp;lt;code&amp;gt;review_mapping_helper_spec.rb&amp;lt;/code&amp;gt; example of some of the test cases are below&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
describe 'test calculate_key_chart_information' do&lt;br /&gt;
   it 'should return new Hash if intervals are not empty' do&lt;br /&gt;
      intervals = [1.00, 2.00, 3.00, 4.00, 5.00, 6.00]&lt;br /&gt;
      result = helper.calculate_key_chart_information(intervals)&lt;br /&gt;
      expect(result).to be_a_kind_of(Hash)&lt;br /&gt;
      expect(result[:mean]).to eq(3.50)&lt;br /&gt;
      expect(result[:min]).to eq(1.00)&lt;br /&gt;
      expect(result[:max]).to eq(6.00)&lt;br /&gt;
      expect(result[:variance]).to eq(2.92)&lt;br /&gt;
      expect(result[:stand_dev]).to eq(1.71)&lt;br /&gt;
    end&lt;br /&gt;
    it 'returns the mean, min, max, variance, and standard deviation of the intervals' do&lt;br /&gt;
      expect(calculate_key_chart_information([10, 15, 20])).to eq(mean: 15.0, min: 10, max: 20, variance: 16.67, stand_dev: 4.08)&lt;br /&gt;
      expect(calculate_key_chart_information([5, 8, 12, 15, 20])).to eq(mean: 12.0, min: 5, max: 20, variance: 27.6, stand_dev: 5.25)&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals are empty' do&lt;br /&gt;
      it 'returns an empty hash' do&lt;br /&gt;
        # Test case 4&lt;br /&gt;
        expect(calculate_key_chart_information([])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when intervals contain values greater than the threshold' do&lt;br /&gt;
      it 'ignores those intervals and returns an empty hash' do&lt;br /&gt;
        expect(calculate_key_chart_information([60, 45, 35])).to eq({})&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
describe 'test calibration_report_css_class' do&lt;br /&gt;
    context 'when the difference is 0' do&lt;br /&gt;
      it 'returns c5 as the CSS class' do&lt;br /&gt;
        css0 = helper.calibration_report_css_class(0)&lt;br /&gt;
        expect(css0). to eq('c5')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 1' do&lt;br /&gt;
      it 'returns c4 as the CSS class' do&lt;br /&gt;
        css1 = helper.calibration_report_css_class(-1)&lt;br /&gt;
        expect(css1). to eq('c4')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 2' do&lt;br /&gt;
      it 'returns c3 as the CSS class' do&lt;br /&gt;
        css2 = helper.calibration_report_css_class(-2)&lt;br /&gt;
        expect(css2). to eq('c3')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is 3' do&lt;br /&gt;
      it 'returns c2 as the CSS class' do&lt;br /&gt;
        css3 = helper.calibration_report_css_class(-3)&lt;br /&gt;
        expect(css3). to eq('c2')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'when the difference is greater than 3' do&lt;br /&gt;
      it 'returns c1 as the CSS class' do&lt;br /&gt;
        css4 = helper.calibration_report_css_class(6)&lt;br /&gt;
        expect(css4). to eq('c1')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The image below shows the test cases are passing as well as most of the code climate issues were resolved.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152445</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=152445"/>
		<updated>2023-12-05T01:53:47Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #10:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' The method &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt; is not clear in terms of its utility&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;list_review_submissions&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It is not clear what the method does, where its used and if it can be replaced.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Comments (shown below) have been added to explain the usage of the method both at the method call in the partial &amp;lt;code&amp;gt;_review_report.html.erb&amp;lt;/code&amp;gt; and the method definition in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;review_mapping_helper&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Extracts the files submitted for a particular pair of participant and reviewee&lt;br /&gt;
  def list_review_submissions(participant_id, reviewee_team_id, response_map_id)&lt;br /&gt;
    participant = Participant.find(participant_id)&lt;br /&gt;
    team = AssignmentTeam.find(reviewee_team_id)&lt;br /&gt;
    html = ''&lt;br /&gt;
    unless team.nil? || participant.nil?&lt;br /&gt;
      # Build a path to the review submissions using the team's path and the response map ID&lt;br /&gt;
      review_submissions_path = team.path + '_review' + '/' + response_map_id.to_s&lt;br /&gt;
      files = team.submitted_files(review_submissions_path)&lt;br /&gt;
      html += display_review_files_directory_tree(participant, files) if files.present?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;_review_report&amp;lt;/code&amp;gt; code snippet&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Following Table entry displays review submissions for specific reviewer and reviewee&lt;br /&gt;
&amp;lt;%= list_review_submissions(reviewer.id, reviewer_map.reviewee_id, reviewer_map.id) %&amp;gt;&lt;br /&gt;
&amp;lt;!--Hard-coded Dr.Kidd's question in order to display link.--&amp;gt;&lt;br /&gt;
&amp;lt;!--later we can create a hyperlink question type to deal with this situation.--&amp;gt;&lt;br /&gt;
&amp;lt;%= list_hyperlink_submission(reviewer_map.id, 5386) if Assignment.find_by(id: @id.to_i).try(:course).try(:instructor).try(:name) == 'Jkidd'%&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Justification for keeping the method:''' &amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; The method has been added to the helper to reduce the complexity of logic in the views which is inherently good programming practice&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; It builds the parameters required to feed into &amp;lt;code&amp;gt;display_review_files_directory_tree&amp;lt;/code&amp;gt; method - a piece of logic that otherwise would have reduced the readability of the code in the partial&amp;lt;br&amp;gt;&lt;br /&gt;
-&amp;gt; Although the helper is just used at one place, its necessary to generate review report tables and hence seems to be the appropriate solution in terms of both functionality and code readability&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All links related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After Project 3 we have changed some method and variable names to improve readability of review_mapper_helper.rb and relevant file and made appropriate changes in respective test files to make sure all test cases are passing. Some new test cases have been added in review_mapping_helper_spec.rb example of some of the test cases are below&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151794</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151794"/>
		<updated>2023-11-25T06:11:55Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&lt;br /&gt;
Below is the original code&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def team_color(response_map)&lt;br /&gt;
    # Storing redundantly computed value in a variable &lt;br /&gt;
    assignment_created = @assignment.created_at&lt;br /&gt;
    # Storing redundantly computed value in a variable&lt;br /&gt;
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)&lt;br /&gt;
    # Returning color based on conditions&lt;br /&gt;
    if Response.exists?(map_id: response_map.id)&lt;br /&gt;
      if !response_map.try(:reviewer).try(:review_grade).nil?&lt;br /&gt;
        'brown'&lt;br /&gt;
      elsif response_for_each_round?(response_map)&lt;br /&gt;
        'blue'&lt;br /&gt;
      else&lt;br /&gt;
        obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      'red'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # loops through the number of assignment review rounds and obtains the team color&lt;br /&gt;
  def obtain_team_color(response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
    color = []&lt;br /&gt;
    (1..@assignment.num_review_rounds).each do |round|&lt;br /&gt;
      check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    end&lt;br /&gt;
    color[-1]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # checks the submission state within each round and assigns team color&lt;br /&gt;
  def check_submission_state(response_map, assignment_created, assignment_due_dates, round, color)&lt;br /&gt;
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      color.push 'purple'&lt;br /&gt;
    else&lt;br /&gt;
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)&lt;br /&gt;
      if link.nil? || (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future&lt;br /&gt;
        color.push 'green'&lt;br /&gt;
      else&lt;br /&gt;
        link_updated_at = get_link_updated_at(link)&lt;br /&gt;
        color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''Solution:''' First we understood the color coding scheme based on the references provided to us and based on which the code was refactored to address the problem. Below are the changes that were made&lt;br /&gt;
* The colour word was replaced by color for consistency&lt;br /&gt;
* In order to improve the readability  the cognitive complexity and branching was reduced by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* comments were added providing an explanation of what the code does&lt;br /&gt;
* making sure proper color get assigned based on the review status&lt;br /&gt;
* better variable and method names wherever needed.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue-8-updated-team-color.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
----&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-8-updated-team-color.png&amp;diff=151793</id>
		<title>File:E2353-issue-8-updated-team-color.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-8-updated-team-color.png&amp;diff=151793"/>
		<updated>2023-11-25T05:53:29Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151791</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151791"/>
		<updated>2023-11-17T21:01:24Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project 4 - DESIGN DOC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
Below is an UML diagram already uploaded in Expertiza database documentation for reader reference&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Review mappings imported.png|700px]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151790</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151790"/>
		<updated>2023-11-17T20:54:32Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project 4 - DESIGN DOC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
====Design Patterns====&lt;br /&gt;
The Code present in review_mapping_helper can be improved by using design patterns to improve maintainability, readability, and flexibility.&lt;br /&gt;
Following are some design patterns that are suggested &lt;br /&gt;
&lt;br /&gt;
* Methods can be extracted into smaller, well maintained with just a single responsibility. This will promote code readability and promote code reuse.&lt;br /&gt;
&lt;br /&gt;
*The methods review_report_data, team_color, obtain_team_color, and others follow a common sequence of steps but allow for variation in some steps. Applying the Template Method Pattern can help define a common structure in a base method while allowing specific steps to be implemented in subclasses or overridden in derived methods.&lt;br /&gt;
&lt;br /&gt;
*Descriptive and short naming conventions are required so the methods and variables are self explanatory.&lt;br /&gt;
&lt;br /&gt;
* Separation of Concerns should be followed for following code.&lt;br /&gt;
&lt;br /&gt;
====Work Plan====&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151789</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151789"/>
		<updated>2023-11-17T20:44:27Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project 4 - DESIGN DOC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-7-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
[[File:E2353-issue-8-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-9-orignal-issue.png|700px]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-9-orignal-issue.png&amp;diff=151788</id>
		<title>File:E2353-issue-9-orignal-issue.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-9-orignal-issue.png&amp;diff=151788"/>
		<updated>2023-11-17T20:42:41Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-8-orignal-issue.png&amp;diff=151787</id>
		<title>File:E2353-issue-8-orignal-issue.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-8-orignal-issue.png&amp;diff=151787"/>
		<updated>2023-11-17T20:41:23Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-7-orignal-issue.png&amp;diff=151786</id>
		<title>File:E2353-issue-7-orignal-issue.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-7-orignal-issue.png&amp;diff=151786"/>
		<updated>2023-11-17T20:37:06Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151785</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151785"/>
		<updated>2023-11-17T20:34:53Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project 4 - DESIGN DOC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green. &lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151784</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151784"/>
		<updated>2023-11-17T20:34:03Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project 4 - DESIGN DOC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #5:''' There is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; list_review_submissions &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view. Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
[[File:E2353-issue-5-orignal-issue.png]]&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why previous students implemented this method&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure. It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed. It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it. Doing the same thing with partials in views/reports would make the code easier to follow&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report &amp;lt;/code&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* There are several methods for feedback_response_maps. &lt;br /&gt;
*  It is not at all clear why they are here. Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* Reading the Expertiza Wiki to understand why this method was originally implemented&lt;br /&gt;
* Reading the code and the usages of this method to understand how it's being used&lt;br /&gt;
* refactor to make better variable and method names if necessary.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green. &lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:''' get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* The method computes an overall score based upon scores awarded in individual rounds, but score calculation is being standardized now in response_map.rb and the method needs to be modified to use the new code. &lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The score calculation code in response_map.rb needs to be understood thoroughly and as stated, has to be used in the &amp;lt;code&amp;gt;get_awarded_review_score&amp;lt;/code&amp;gt; method&lt;br /&gt;
* We plan to contact Nicholas to get further clarity in our understanding of the code before we proceed to use it&lt;br /&gt;
* We will add comments as necessary once the standardized code has been utilized in the review mapping helper so that readers can understand what the code fragments are doing&lt;br /&gt;
* The current variable names will be improved&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-5-orignal-issue.png&amp;diff=151783</id>
		<title>File:E2353-issue-5-orignal-issue.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue-5-orignal-issue.png&amp;diff=151783"/>
		<updated>2023-11-17T20:33:22Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151334</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151334"/>
		<updated>2023-11-14T20:44:19Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
=='''Project 4 - DESIGN DOC'''==&lt;br /&gt;
Following are the changes we have been assigned to do after completion of project 3&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
Apart from these issues we have added some issues of our own based on the feedback of project 3 review which are as follows&lt;br /&gt;
&lt;br /&gt;
* A lot of variables are difficult to understand and hence we plan to refactor the variable for better readability and understanding&lt;br /&gt;
* We were not able to increase the code coverage after our changes during project 3. Here in project 4 we want to focus on writing more tests and using the test skeleton.&lt;br /&gt;
&lt;br /&gt;
The plan of work on the above issues is as follows&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
*'''Issue #8:''' Refactoring the methods providing color coding in review report&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;obtain_team_color&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;check_submission_state&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' following are the problems here as stated by the task &amp;lt;br/&amp;gt;&lt;br /&gt;
* American work color has to be used everywhere instead of colour&lt;br /&gt;
* The readability and understandability of the code is less&lt;br /&gt;
* no proper comments to explain what is going on in the code&lt;br /&gt;
* The color coding requirements are met that are, team review is coded as red if review is not completed and blue indicates that the review grade is not assigned or updated. In case the reviewer did not have anything to review in the latest round, and should not be downgraded for not re-reviewing the work, these reviews should be coded green. &lt;br /&gt;
'''Solution:'''Below are the solutions proposed&amp;lt;br/&amp;gt;&lt;br /&gt;
* The colour word has to be replaced by color for consistency&lt;br /&gt;
* In order to improve the readability we can reduce the cognitive complexity and branching by using less if-else block and further dividing the method into multiple block.&lt;br /&gt;
* More comments can be added to make sure the reader understands what each line does in these methods.&lt;br /&gt;
* make sure proper color get assigned based on the review status by making sure all tests pass after refactoring and maybe new test cases can be added&lt;br /&gt;
* there are some unwanted array data structure used in order to pass the color code which should be removed to reduce complexity.&lt;br /&gt;
* better variable and method names if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #6:''' The Last 3 Classes in review_helper need to be reviewed&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (separate methods for both the sub classes)&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' The file ends with three small classes being defined. There are no comments at all to explain what is being done&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The usage of the three classes was traced back to assignment views and ReviewMappingController. It is evident that these classes have been used to encapsulate the logic for different review strategies in the system. Some comments have been added to explain the functionality of these classes.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_strategy classes'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Issue-6.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Further explanation of the methods:'''&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_needed&amp;lt;/code&amp;gt; :  Calculates the total number of reviews needed for all teams/participants&amp;lt;br&amp;gt; &lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_team&amp;lt;/code&amp;gt; : Calculates the number of reviews each team should receive&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for StudentReviewStrategy) : Specifies the number of reviews each student should perform&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;reviews_per_student&amp;lt;/code&amp;gt; (for TeamReviewStrategy) : Specifies the number of reviews each student should perform based on team assignments&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Aditya Joshi&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151123</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151123"/>
		<updated>2023-11-05T01:10:41Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Plan of work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing document]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151122</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151122"/>
		<updated>2023-11-05T01:04:46Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-Test-Report.png|250px]]&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-Test-Report.png&amp;diff=151121</id>
		<title>File:E2353-Test-Report.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-Test-Report.png&amp;diff=151121"/>
		<updated>2023-11-05T01:03:21Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151120</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151120"/>
		<updated>2023-11-05T00:21:26Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png|900px]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png|900px]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151119</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151119"/>
		<updated>2023-11-05T00:19:57Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353-issue4-3.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151118</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151118"/>
		<updated>2023-11-05T00:18:48Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper_spec.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:File:E2353-issue4-3.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue4-3.png&amp;diff=151117</id>
		<title>File:E2353-issue4-3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-issue4-3.png&amp;diff=151117"/>
		<updated>2023-11-05T00:18:04Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151116</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151116"/>
		<updated>2023-11-04T22:12:41Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
This is a refactoring project, so it is expected that the original functionality should be retained. Some of the task involved adding comments to previous code, changing variable name etc. which no change was required in test cases. Some methods where method names were changed or they were shifted to other files, for these methods necessary changes were made in respective Rspec files. All the test cases passed which implies that the refactored code did not break the existing functionality.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151115</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151115"/>
		<updated>2023-11-04T22:04:13Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below. Since it was used in &amp;lt;code&amp;gt;review_report&amp;lt;/code&amp;gt; partial the implementation was changed there as well&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png]] &amp;lt;br&amp;gt;&lt;br /&gt;
'''app/views/reports/_review_report.html.erb'''&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:E2353issue-4-2.png]] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-10395a909ed1f2034b4a4c8f57c0e30382d9492e0b16bb6fe6fb91a424f6f034 _review_report.html.erb] &amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-1f05f505eaa5edaf0790cdeb6e774cc499685cce4edf12b253ecd358ce710582 review_mapping_helper_spec.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353issue-4-2.png&amp;diff=151114</id>
		<title>File:E2353issue-4-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353issue-4-2.png&amp;diff=151114"/>
		<updated>2023-11-04T22:00:25Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151113</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151113"/>
		<updated>2023-11-04T21:56:23Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Name&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #4:''' The method &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' Currently the method sort_reviewer_by_review_volume_desc sorts the reviewers in descending order but only considers one metric which is review volume which makes it very specific and it cannot be used if we want to sort by other metrics&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''The solution here is make this a generalized method by renaming &amp;lt;code&amp;gt;sort_reviewer_by_review_volume_desc&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;sort_reviewer_desc&amp;lt;/code&amp;gt; and accepting a metric as argument on which we can sort the the reviewers as shown below&amp;lt;br/&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[File: E2353-Issue-4-1.png]]&lt;br /&gt;
app/views/reports/_review_report.html.erb&lt;br /&gt;
&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-Issue-4-1.png&amp;diff=151112</id>
		<title>File:E2353-Issue-4-1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:E2353-Issue-4-1.png&amp;diff=151112"/>
		<updated>2023-11-04T21:53:45Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151111</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151111"/>
		<updated>2023-11-04T21:25:15Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
please use this template&lt;br /&gt;
*'''Issue #[number]:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
*'''Issue #3:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
*'''Issue #[4]:''' The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume. Other metrics might include number of suggestions, or number of suggestions + number of problems detected. This method should not be counting the number of review rounds! Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' text&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' text &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:'''text, code, images if any&amp;lt;br/&amp;gt;&lt;br /&gt;
'''All link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151110</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151110"/>
		<updated>2023-11-04T21:17:18Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Issues to be Addressed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #4:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151109</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151109"/>
		<updated>2023-11-04T21:13:47Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Issues to be Addressed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #1:''' method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* '''Issue #2:'''The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #3:'''Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* '''Issue #4:'''get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #5:'''The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #6:'''The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #7:'''Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* '''Issue #8:'''There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* '''Issue #9:'''The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151108</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151108"/>
		<updated>2023-11-04T21:10:42Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Github Links==&lt;br /&gt;
===Link to Expertiza Repository===&lt;br /&gt;
https://github.com/expertiza/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Forked Repository===&lt;br /&gt;
https://github.com/adityajoshi1114/expertiza &amp;lt;br&amp;gt;&lt;br /&gt;
===Link to Pull Request===&lt;br /&gt;
https://github.com/expertiza/expertiza/pull/2663&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151107</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151107"/>
		<updated>2023-11-04T21:01:19Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code and discussing the flow of the project in detail with our mentor. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]. then we distributed the tasks among us and started refactoring various methods and creating new files as and when necessary. We also ensured the test cases passing earlier were intact and added new ones if necessary.&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin and also each of the methods more than 30 lines inside them making them too large&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' distributed this code among 2 newly created files named &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; within helper folder. This way the chart helper methods are separated from review_mapping_helper where they are out of place and difficult for any developer to find. &amp;lt;code&amp;gt;review_mapping_charts_helper.rb&amp;lt;/code&amp;gt; contains the original methods and &amp;lt;code&amp;gt;data_mapping_helper.rb&amp;lt;/code&amp;gt; manages the data need by these chart methods&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''review_mapping_charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ReviewMappingChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''all link related to these changes:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-e2d994d01ebf485444d434603035df8e07eb9db7e625cfc42e7ad83f5b5c333e review_mapping_charts_helper.rb] &amp;lt;br&amp;gt;[https://github.com/expertiza/expertiza/pull/2663/files#diff-c41058c9caa3baa134bad689e28b7903d372d6a64388daccbb2e0ced964da568 review_mapping_helper.rb] &amp;lt;br&amp;gt; &lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/2663/files#diff-ab7a32a37c43b8681f146d9e7e420aee006c8a435e11c45944ac8a13f941c969 data_mapping_helper.rb]&amp;lt;br&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151106</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151106"/>
		<updated>2023-11-04T20:44:41Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in &amp;lt;code&amp;gt;app/helpers/review_mapping_helper.rb&amp;lt;/code&amp;gt; file. We have have refactored some methods mentioned below for better understanding while maintaining the functionality. The aim is to also make it better understandable for other developers by adding comments wherever necessary. &lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
===Mentor===&lt;br /&gt;
Devashish Vachhani (dvachha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Harsh Mauny (hrmauny@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Connor Davidson (cdavids@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
Aditya Joshi (ajoshi25@ncsu.edu)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in review_mapping_helper.rb&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' Added these methods to an already present helper method &amp;lt;code&amp;gt;charts_helper.rb&amp;lt;/code&amp;gt; within helper folder. this way the chart helper method are separted from review_mapping_helper where they are out of place and difficult for any developer to find&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb''' &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module ReviewMappingHelper &lt;br /&gt;
    include ChartsHelper&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151066</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=151066"/>
		<updated>2023-11-03T15:05:11Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
==Plan of work==&lt;br /&gt;
We started our work by analysing the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; how it links to rest of the code. Based on our understanding of the code we divided our project requirements in terms of difficulty levels as shown in the document [https://docs.google.com/document/d/1AmXVfhH3icn8Pc9oJ3U7okER2NhBDIFFtFxTofmrKcE/edit?usp=sharing]&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
*  app/views/reports/_calibration_report.html.erb&lt;br /&gt;
*  app/views/reports/_feedback_report.html.erb&lt;br /&gt;
*  app/views/reports/_review_report.html.erb&lt;br /&gt;
*  app/views/reports/_team_score.html.erb&lt;br /&gt;
*  app/views/reports/_team_score_score_awarded.html.erb&lt;br /&gt;
*  spec/features/review_mapping_helper_spec.rb&lt;br /&gt;
*  spec/helpers/review_mapping_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in review_mapping_helper.rb&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' Added these methods to an already present helper method &amp;lt;code&amp;gt;charts_helper.rb&amp;lt;/code&amp;gt; within helper folder. this way the chart helper method are separted from review_mapping_helper where they are out of place and difficult for any developer to find&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb''' &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module ReviewMappingHelper &lt;br /&gt;
    include ChartsHelper&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''Issue #2:''' change methods names starting with &amp;quot;get&amp;quot; to something appropriate&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; get_data_for_review_report()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_color()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_link_updated_at()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_team_reviewed_link_name()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_awarded_review_score()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_each_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_certain_review_and_feedback_response_map()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt; get_css_style_for_calibration_report()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code used &amp;quot;get&amp;quot; in method names&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' All these methods used &amp;quot;get_&amp;quot; which is not ruby-like.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' change method names to a more ruby-like name that was appropriate for the given context&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Issue #7:''' Several methods for feedback_response_maps, check docs to manage this confusion&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt; feedback_response_for_author()&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Previous Code:''' previous code had an ambiguous variable name&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Problem:''' It wasn't clear what the variable was used for.  &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Solution:''' refactor the variable name to be more easily understood and add comments to give a clear explanation for why it exists&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Connor Davidson&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150680</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150680"/>
		<updated>2023-10-30T23:21:07Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: /* Project tracking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in review_mapping_helper.rb&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' Added these methods to an already present helper method &amp;lt;code&amp;gt;charts_helper.rb&amp;lt;/code&amp;gt; within helper folder. this way the chart helper method are separted from review_mapping_helper where they are out of place and difficult for any developer to find&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''charts_helper.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module  ChartsHelper&lt;br /&gt;
...&lt;br /&gt;
    def initialize_chart_elements()&lt;br /&gt;
    def display_volume_metric_chart()&lt;br /&gt;
    def display_tagging_interval_chart()&lt;br /&gt;
    def calculate_key_chart_information()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''review_mapping_helper.rb''' &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module ReviewMappingHelper &lt;br /&gt;
    include ChartsHelper&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&lt;br /&gt;
    ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150676</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150676"/>
		<updated>2023-10-30T23:16:43Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Our project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;br /&gt;
&lt;br /&gt;
==Project tracking==&lt;br /&gt;
* '''Issue #1:''' make a separate file for for chart related elements in review_mapping_helper.rb&amp;lt;br&amp;gt;&lt;br /&gt;
'''Methods involved:''' &amp;lt;code&amp;gt;initialize_chart_elements()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_volume_metric_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;display_tagging_interval_chart()&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;calculate_key_chart_information()&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Previous Code:''' All these methods were previously a part of the &amp;lt;code&amp;gt;review_mapping_helper.rb&amp;lt;/code&amp;gt; when it should have its separate helper file&amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem:''' These methods perform similar tasks of generating graphs and can have there separate module or a mixin&amp;lt;br&amp;gt;&lt;br /&gt;
'''Solution:''' Added these methods to an already present helper method &amp;lt;code&amp;gt;charts_helper.rb&amp;lt;/code&amp;gt; within helper folder. this way the chart helper method are separted from review_mapping_helper where they are out of place and difficult for any developer to find&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Contributor:''' Harsh Mauny&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150666</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150666"/>
		<updated>2023-10-30T23:00:00Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Over project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;br /&gt;
&lt;br /&gt;
==Issues to be Addressed==&lt;br /&gt;
&lt;br /&gt;
* method get_data_for_review_report marshals a lot of data together and passes back a data structure.  It is used in views/reports/_review_report.html.erb, but it is quite difficult to see how the data is being displayed.  It violates the Expert pattern, because the view needs to know how to break apart the structure that is passed to it.  Doing the same thing with partials in views/reports would make the code easier to follow&lt;br /&gt;
&lt;br /&gt;
* The next three methods involve team “color”.  Color-coding is explained on this page and this page for the E1789 project and this page for E1815.  The code for these methods is not at all clear, and should be refactored.  And please use the American spelling “color”.&lt;br /&gt;
&lt;br /&gt;
* Various method names begin with get.  This is not Ruby-like.  Change the names to something more appropriate.&lt;br /&gt;
* get_awarded_review_score computes an overall score based upon scores awarded in individual rounds. This is one of many places in Expertiza where scores are being calculated.  Score-calculation code for multiple rounds is being standardized now, in response_map.rb.  Contact Nicholas Himes (nnhimes@ncsu.edu) for particulars.  Change this method to use the new code.&lt;br /&gt;
&lt;br /&gt;
* The method sort_reviewer_by_review_volume_desc should be generalized so that it can sort by any metric, not just review volume.  Other metrics might include number of suggestions, or number of suggestions + number of problems detected.  This method should not be counting the number of review rounds!  Since other places in the code will need to know the number of review rounds, it should be calculated somewhere else in the system.&lt;br /&gt;
&lt;br /&gt;
* The next several methods generate charts.  They are cohesive enough that they should be in their own separate file, either another helper or a mixin.&lt;br /&gt;
&lt;br /&gt;
* Then there is a method list_review_submissions. It’s not at all clear that this method is needed, though it is used in one view.  Look on the Expertiza wiki and see if there is a better way. &lt;br /&gt;
&lt;br /&gt;
* There are several methods for feedback_response_maps.  It is not at all clear why they are here.  Look on the Expertiza wiki for the documentation, and see if you can replace them by calls to other methods, or at least make it clearer what they are doing.&lt;br /&gt;
&lt;br /&gt;
* The file ends with three small classes being defined.  There are no comments at all to explain what is being done.  Look them up on the Expertiza wiki and refactor or comment them, whichever seems more appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
*  app/helpers/charts_helper.rb&lt;br /&gt;
*  app/helpers/review_mapping_helper.rb&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023&amp;diff=150653</id>
		<title>CSC/ECE 517 Fall 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023&amp;diff=150653"/>
		<updated>2023-10-30T22:49:21Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2023 - E2358. Refactor student_quizzes_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2351. Finish mentor management for assignments without topics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2359. Refactor user_controller.rb, user.rb, and its child classes]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2367. Reimplement participants_controller.rb, participants.rb and its child classes]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2355. Improving Search Facility In Expertiza]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2365. Create a user interface for Questionnaire in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2364. Create a UI for Course's &amp;amp; Assignment's &amp;quot;Add Participants&amp;quot; page]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2361. Create a page to create and update a Questionnaire in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2362. Create a page to edit an Assignment's due date in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2363. Create a UI for Assignment Edit page &amp;quot;Etc&amp;quot; tab in ReactJS]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2375. Reimplement Waitlists]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2357. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2366. Reimplement assignment model and assignment controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2370. Reimplement join team requests controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2371. Reimplement quiz_questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2369. Reimplement duties controller.rb and badges controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper]]&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150647</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150647"/>
		<updated>2023-10-30T22:45:59Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Problem Statement==&lt;br /&gt;
Over project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150645</id>
		<title>CSC/ECE 517 Fall 2023 - E2353. Further refactoring and improvement of review mapping helper</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2353._Further_refactoring_and_improvement_of_review_mapping_helper&amp;diff=150645"/>
		<updated>2023-10-30T22:42:52Z</updated>

		<summary type="html">&lt;p&gt;Hrmauny: Created page with &amp;quot;Over project concentrates on making things readable and understandable in review_mapping_helper.rb file&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Over project concentrates on making things readable and understandable in review_mapping_helper.rb file&lt;/div&gt;</summary>
		<author><name>Hrmauny</name></author>
	</entry>
</feed>