Showing 25 of 51 total issues
File jquery.joyride-2.1.js
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* jQuery Foundation Joyride Plugin 2.1
* http://foundation.zurb.com
* Copyright 2013, ZURB
* Free to use under the MIT license.
Function mask
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
mask: function(mask, settings) {
var input, defs, tests, partialPosition, firstNonMaskPos, lastRequiredNonMaskPos, len, oldVal;
if (!mask && this.length > 0) {
input = $(this[0]);
var fn = input.data($.mask.dataName);
Function init
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
init : function (opts) {
return this.each(function () {
if ($.isEmptyObject(settings)) {
settings = $.extend(true, defaults, opts);
Function show
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
show : function (init) {
var opts = {}, ii, opts_arr = [], opts_len = 0, p,
$timer = null;
// are we paused?
Function ready_groups_index
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ready_groups_index = function() {
updateListing();
$(".inactive").hide();
updateGroupCount();
Function ready_groups_index
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
var ready_groups_index = function() {
updateListing();
$(".inactive").hide();
updateGroupCount();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pos_default
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
pos_default : function (init) {
var half_fold = Math.ceil(settings.$window.height() / 2),
tip_position = settings.$next_tip.offset(),
$nub = $('.joyride-nub', settings.$next_tip),
nub_width = Math.ceil($nub.outerWidth() / 2),
Function expose
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
expose: function(){
var expose,
exposeCover,
el,
origCSS,
Function un_expose
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
un_expose: function(){
var exposeId,
el,
expose ,
origCSS,
Method create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create
build_resource(sign_up_params)
resource.save
yield resource if block_given?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function pos_phone
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
pos_phone : function (init) {
var tip_height = settings.$next_tip.outerHeight(),
tip_offset = settings.$next_tip.offset(),
target_height = settings.$target.outerHeight(),
$nub = $('.joyride-nub', settings.$next_tip),
Function ready_groups_show
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ready_groups_show = function() {
$(".false").hide();
function menu_clicked(event) {
// unselected others
Method notifications
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def notifications
@group = Group.find(params[:id])
@user_group = current_user.user_groups.where(group_id: @group.id).first
if @user_group && @user_group.group_email_notifications
@email_notif = @user_group.group_email_notifications
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Consider simplifying this complex logical expression. Open
if (!input.prop("readonly")) {
var pos, begin, end, k = e.which || e.keyCode;
oldVal = input.val(), 8 === k || 46 === k || iPhone && 127 === k ? (pos = input.caret(),
begin = pos.begin, end = pos.end, end - begin === 0 && (begin = 46 !== k ? seekPrev(begin) : end = seekNext(begin - 1),
end = 46 === k ? seekNext(end) : end), clearBuffer(begin, end), shiftL(begin, end - 1),
Method update_organizers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def update_organizers(current_user, organizers)
@event_organizers = [current_user]
if organizers
@event_organizers.concat(User.find(organizers))
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@group = Group.new(group_params)
if @group.save
if !params[:selected_leaders].blank?
@users = User.find(params[:selected_leaders].split(","))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function resize_navbar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var resize_navbar = function() {
if($(window).width() < 640){
$(".dropdown").children().each(function(index) {
if(index > 1){
$(".dropdown").parent().parent()[0].appendChild($(this)[0]);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (settings.timer > 0) {
settings.$next_tip.fadeIn(settings.tipAnimationFadeSpeed);
settings.$next_tip.show();
Consider simplifying this complex logical expression. Open
if (!(e.ctrlKey || e.altKey || e.metaKey || 32 > k) && k && 13 !== k) {
if (pos.end - pos.begin !== 0 && (clearBuffer(pos.begin, pos.end), shiftL(pos.begin, pos.end - 1)),
p = seekNext(pos.begin - 1), len > p && (c = String.fromCharCode(k), tests[p].test(c))) {
if (shiftR(p), buffer[p] = c, writeBuffer(), next = seekNext(p), android) {
var proxy = function() {
Function ready_error
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var ready_error = function() {
if ($('.flash_error').length > 0) {
var error = $('.flash_error').html();
if (error.indexOf("sign_in") > -1 ) {
$('#login').foundation('reveal', 'open');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"