Showing 146 of 242 total issues
File sugar.js
has 4177 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Sugar Library edge
*
* Freely distributable and licensed under the MIT-style license.
* Copyright (c) 2015 Andrew Plummer
Method menu_code
has a Cognitive Complexity of 463 (exceeds 5 allowed). Consider refactoring. Open
def self.menu_code(resource)
case resource
when :areas
Proc.new do |primary, options|
primary.item :areas, I18n.t('areas.index.title'), areas_path do |areas|
- 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 menu_code
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.menu_code(resource)
case resource
when :areas
Proc.new do |primary, options|
primary.item :areas, I18n.t('areas.index.title'), areas_path do |areas|
File jquery-competitive_list.js
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
(function($, window) {
var CompetitiveList;
CompetitiveList = CompetitiveList = (function() {
CompetitiveList.prototype.jqueryInstanceMethodName = 'competitiveList';
Function getExtendedDate
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getExtendedDate(contextDate, f, localeCode, prefer, forceUTC) {
// TODO can we split this up into smaller methods?
var d, relative, baseLocalization, afterCallbacks, loc, set, unit, unitIndex, weekday, num, tmp, weekdayForward;
afterCallbacks = [];
Method up
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
def up
MongoDatabaseCleaner.clean
create_table :users do |t|
t.string :name
Function setLocalization
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setLocalization(localeCode, set) {
var loc;
function initializeField(name) {
var val = loc[name];
Method included
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(base)
base.class_eval do
include ErrorHandling
include TransitionActions
File jquery.location_picker.js
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function ( $ ) {
/**
* Holds google map object and related utility entities.
* @constructor
Function multisortable
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.multisortable = function(options) {
if (!options) {
options = {}
}
var settings = $.extend({}, $.fn.multisortable.defaults, options);
Function locationpicker
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.locationpicker = function( options, params ) {
if (typeof options == 'string') { // Command provided
var _targetDomElement = this.get(0);
// Plug-in is not applied - nothing to do.
if (!isPluginApplied(_targetDomElement)) return;
Method included
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def self.included(base)
base.extend ClassMethods
base.class_eval do
include Model::MongoDb::StateVersionAttributes
- 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 buildBase64
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildBase64(key) {
var encodeAscii, decodeAscii;
function catchEncodingError(fn) {
return function(str) {
Method create_from_table
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def create_from_table(model_name, table, extra = {})
factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym
is_singular = model_name.to_s.singularize == model_name.to_s
hashes = if is_singular
- 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_from_table
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def create_from_table(model_name, table, extra = {})
factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym
is_singular = model_name.to_s.singularize == model_name.to_s
hashes = if is_singular
- 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_from_table
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def create_from_table(model_name, table, extra = {})
factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym
is_singular = model_name.to_s.singularize == model_name.to_s
hashes = if is_singular
- 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 buildDateMethods
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildDateMethods() {
extendSimilar(date, DateUnits, function(methods, u, i) {
var name = u.name, caps = simpleCapitalize(name), since, until;
u.addMethod = 'add' + caps + 's';
Function multiselectable
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.multiselectable = function(options) {
if (!options) {
options = {}
}
options = $.extend({}, $.fn.multiselectable.defaults, options);
Function init
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init (converter) {
function api (key, value, attributes) {
var result;
// Write
Method update
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def update
if params[:event] && params[:event].keys.select{|k| ['cancel', 'skip'].include?(k)}.any?
send(params[:event].keys.first)
return
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"