E1917 Fix Code Climate Issues

From Expertiza_Wiki
Jump to navigation Jump to search

About Expertiza

Expertiza is an open source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages[1].

Code Climate Issues and Problem Statements

Codeclimate is a command line interface for the Code Climate analysis platform. It could detect code smells which violate ruby/rails best practices. The task is to fix certain code climate issues detected by Code Climate analysis platform in controllers with the name begin with P to Z. Those issues includes unsafe use of methods, inappropriate syntax, non-optimal code structure and so on. There are totally 48 different types of issues fixed in this project.

Implementation

We will show a few important issues we fixed.

Testing

The Expertiza project provides 77 rspec tests under expertiza/spec. 8 of them are related to our controllers files. After modifying those 28 files, we want to make sure these tests could still pass.

Reference

[[1]]' Code Climate General Description https://github.com/codeclimate/codeclimate/blob/master/README.md