File waypoints.min.js
has 479 lines of code (exceeds 250 allowed). Consider refactoring.
jQuery Waypoints - v2.0.3
Copyright (c) 2011-2013 Caleb Troughton
Dual licensed under the MIT license and GPL license.
Method related_posts
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
def related_posts(me, posts)
return [] unless posts.docs.size > 1
highest_freq = @tag_freq.values.max
related_scores = Hash.new(0)
Function refresh
has 56 lines of code (exceeds 25 allowed). Consider refactoring.
t.prototype.refresh = function() {
var t,
e,
r,
i = this;
Function doScroll
has 48 lines of code (exceeds 25 allowed). Consider refactoring.
t.prototype.doScroll = function() {
var t,
e = this;
t = {
horizontal: {
Function t
has 32 lines of code (exceeds 25 allowed). Consider refactoring.
function t(t) {
var e = this;
this.$element = t;
this.element = t[0];
this.didResize = false;
Method related_posts
has 29 lines of code (exceeds 25 allowed). Consider refactoring.
def related_posts(me, posts)
return [] unless posts.docs.size > 1
highest_freq = @tag_freq.values.max
related_scores = Hash.new(0)
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
module.exports = function($el) {
var data = $el.data(),
key,
validatorName,
validatorPattern,
Function t
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
function t(t, e, r) {
var i, o;
r = n.extend({}, n.fn[g].defaults, r);
if (r.offset === 'bottom-in-view') {
r.offset = function() {
Method find_published_authors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
def find_published_authors
published_authors = []
@site_post_paths.each do |post_path|
next unless File.exist? File.join(Dir.pwd, '_posts', post_path)
Method team_photo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def team_photo(name)
if Jekyll.sites[0].config['env'] != 'development'
baseurl = Jekyll.sites[0].config['baseurl']
default = "<img class='img-circle team-img bio-clip' " \
"src='#{baseurl}/assets/img/SIL-Logo-Animation.gif' alt='SIL logo'>"
Method team_link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def team_link(input)
authors = Jekyll.sites[0].collections['authors'].docs
index = authors.find_index do |x|
if x.data['name'].nil?
puts "No such author: #{input} in #{x}"
Method in_groups
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def in_groups(number, fill_with = nil)
division = size.div number
Consider simplifying this complex logical expression.
if url.is_a? Array
urls = url.map do |u|
page_url = clip_char(page_url.to_s.downcase, '/').split('/')[0]
u = clip_char(u.to_s.downcase, '/').split('/')[0]
Avoid too many return
statements within this function.
return n.error(
'The ' + r + ' method does not exist in jQuery Waypoints.',
);
Method tag_freq
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def tag_freq(posts)
@tag_freq = Hash.new(0)
posts.docs.each do |post|
post.data['categories'].each { |category| @tag_freq[category] += 1 } if @use_categories
post.data['tags'].each { |tag| @tag_freq[tag] += 1 } if @use_tags