SteamedPears / CodeReviewClientMaster

Other
4 stars 3 forks source link

Code duplication #22

Open spratt opened 12 years ago

spratt commented 12 years ago

The code is starting to get a little hairy. We should probably do some serious review and clean it up. There's lots of code duplication, both within view.js and duplicated code across index.js and view.js. We should refactor to use the javascript module pattern, and separate the code into shared code and index/view specific code.

Gankra commented 12 years ago

Can you reference specific areas that are duplicated? I don't see anything that is really bad at this point. Except for maybe mapping line number into {line:,ch:} format.

spratt commented 12 years ago

The html for index and view are almost identical, and much of the utility functions between index and view are shared. Index and view can probably be merged into one file that displays the code submission form if no id is specified and if an id is specified, show the code with that id.