Showing 92 of 4,113 total issues
Function open
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open : function (target, ajax_settings) {
var self = this,
modal;
if (target) {
Function toggle_active_tab
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggle_active_tab : function (tab, location_hash) {
var self = this,
S = self.S,
tabs = tab.closest('[' + this.attr_name() + ']'),
tab_link = tab.find('a'),
Function init
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.init = function () {
self.build_markup();
if (settings.timer) {
timer = self.create_timer();
Foundation.utils.image_loaded(this.slides().children('img'), timer.start);
File foundation.tooltip.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.tooltip = {
name : 'tooltip',
Function events
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function () {
var self = this;
$(this.scope)
.off('.slider')
.on('mousedown.fndtn.slider touchstart.fndtn.slider pointerdown.fndtn.slider',
Function events
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function (scope) {
var self = this,
form = self.S(scope).attr('novalidate', 'novalidate'),
settings = form.data(this.attr_name(true) + '-init') || {};
Method initialize
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(user)
alias_action :create, :read, :update, :destroy, to: :crud
if user
can :home, [User]
File foundation.interchange.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.interchange = {
name : 'interchange',
Function open
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
open : function ($image, current, target) {
var self = this,
body = $(document.body),
root = target.closest('.clearing-assembled'),
container = self.S('div', root).first(),
Function reposition
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reposition : function (target, tip, classes) {
var width, nub, nubHeight, nubWidth, objPos;
tip.css('visibility', 'hidden').show();
Class Membership
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Membership < ActiveRecord::Base
include Commerce::Purchasable
include Commerce::Subscribable
delegate :url_helpers, to: 'Rails.application.routes'
Function events
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
events : function (scope) {
var self = this,
S = self.S;
S(this.scope)
Function toggle
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toggle: function (toggleEl) {
var self = this,
topbar;
if (toggleEl) {
Function show
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show : function (el, css) {
// is modal
if (css) {
var settings = el.data(this.attr_name(true) + '-init') || this.settings,
root_element = settings.root_element,
File foundation.slider.js
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.slider = {
name : 'slider',
Function _goto
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self._goto = function (next_idx, start_timer) {
// if (locked) {return false;}
if (next_idx === idx) {return false;}
if (typeof timer === 'object') {timer.restart();}
var slides = self.slides();
Function data_options
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data_options : function (el, data_attr_name) {
data_attr_name = data_attr_name || 'options';
var opts = {}, ii, p, opts_arr,
data_options = function (el) {
var namespace = Foundation.global.namespace;
Function swipe_events
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
swipe_events : function (scope) {
var self = this,
S = self.S;
S(this.scope)
Method sync
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
def sync
year = Date.current > Date.current.end_of_year - 15.days ? Date.current.year + 1 : Date.current.year
uri = URI.parse("https://v3.football.api-sports.io/fixtures?league=253&season=#{year}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
- 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 Timer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Timer = function (el, settings, callback) {
var self = this,
duration = settings.timer_speed,
progress = el.find('.' + settings.timer_progress_class),
start,