It's because of this:
var $star_rating = $('.star-rating .fa');
It is applying the function to every star-rating class.
You would need to modify that selector to specify which one to change. You could pass the element into setStarRating
Example:
return SetStarRating($(this));
and then use that in the SetRatingStar
method
In response to your comment. I'm feeling generous so here you go: