Stackle is an web communication portal aimed at providing Open Source organizations a platform to have discussions on their github projects and their issues. It provides Github intergration which allows adminstrator of an organization to create a forum thread for the particualr organization. Users signing in is able to view forums of the organizations they contribute to and engage in the forum discussions.
In file validator.js
validation function is using bitwise operator for checking if keys exist in input body which is not good practice in JS code as it produces unreadable code read this. And also Object.keys(this.input) is repeated which affects performance of code as time complexity of Object.keys(this.input) operation is O(n).
Possible fix
We can cache the result of Object.keys(this.input).
Type of issue:
Short description on the issue
In file validator.js validation function is using
bitwise operator
for checking if keys exist in input body which is not good practice in JS code as it produces unreadable code read this. And alsoObject.keys(this.input)
is repeated which affects performance of code as time complexity ofObject.keys(this.input)
operation isO(n)
.Possible fix
We can cache the result of
Object.keys(this.input)
.