CSC/ECE 517 Fall 2016/E1658. Refractor lottery controller.rb and write integration tests

From Expertiza_Wiki
Revision as of 03:58, 28 October 2016 by Radoshi (talk | contribs)
Jump to navigation Jump to search

Expertiza Background

Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and it’s code is available on Github. It allows students to review each other’s work and improve their work upon this feedback.

Description of Current Project

The following is an Expertiza based OSS project which deals primarily with the lottery_controller.rb file. It focusses on refactoring some of the more complex methods, modifying some of the language to make it more Ruby friendly, removing some redundant code. The goal of this project is to attempt to make this part of the application easier to read and maintain. The lottery_controller contains all of the logic for running the lottery.

Changes needed

Fix following issues mentioned below:

  • Cyclomatic complexity for run_intelligent_bid is too high.
  • Perceived complexity for run_intelligent_bid is too high.
  • Use snake_case for variable names.
  • Avoid more than 3 levels of block nesting.

Changes performed

  • Cyclomatic complexity for run_intelligent_bid and other methods is greatly reduced.
  • Perceived complexity for run_intelligent_bid is also reduced.
  • snake_case are used for variable names.
  • More than 3 levels of block nesting is avoided.