Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 codeclimate - ignore a few small duplication issues
* I disagree with codeclimate about these being real issues. * they are things like this, where it's just a few lines: (each with mass=45) Query.prototype.byName = function (name) { this.queryBy = 'name'; this.name = name; return this; }; Query.prototype.bySchoolCode = function (schoolCode) { this.queryBy = 'school_code'; this.school_code = schoolCode; return this; }; Query.prototype.byBounds = function (bounds) { this.queryBy = 'bounds'; this.bounds = bounds; return this; }; * I wish codeclimate's duplication engine would let us differentiate between similar 3-line functions and similar 10+ line functions. * Perhaps something like this would work but it seems like unnecessary complexity to avoid three 3-line functions (and save 5 lines): Query.prototype.byName = Query.by('name', name); Query.prototype.bySchoolCode = Query.by('school_code', schoolCode); Query.prototype.byBounds = Query.by('bounds', bounds); Query.prototype.by = function(param, value) { return function(value) { this.queryBy = param; this[param] = value; return this; } }
- Loading branch information