Showing 49 of 49 total issues
Function addToHome
has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring. Open
var addToHome = (function (w) {
var nav = w.navigator,
isIDevice = 'platform' in nav && (/iphone|ipod|ipad/gi).test(nav.platform),
isIPad,
isRetina,
- 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 addToHome
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
var addToHome = (function (w) {
var nav = w.navigator,
isIDevice = 'platform' in nav && (/iphone|ipod|ipad/gi).test(nav.platform),
isIPad,
isRetina,
Function expander
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.expander = function(options) {
var meth = 'init';
if (typeof options == 'string') {
meth = options;
Function init
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function() {
this.each(function() {
var i, l, tmp, newChar, summTagless, summOpens, summCloses,
lastCloseTag, detailText, detailTagless,
$thisDetails, $readMore,
File bootstrap-datepicker.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* =========================================================
* bootstrap-datepicker.js
* http://www.eyecon.ro/bootstrap-datepicker
* =========================================================
* Copyright 2012 Stefan Petre
Method get_menu_data
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def self.get_menu_data(csv_uri)
old_locale = I18n.locale
I18n.locale = :de
csv = Rails.cache.fetch("iUPB.restaurant_csv", :expires_in => 2.hours) do
- 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 get_menu_data
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.get_menu_data(csv_uri)
old_locale = I18n.locale
I18n.locale = :de
csv = Rails.cache.fetch("iUPB.restaurant_csv", :expires_in => 2.hours) do
Function dateFormat
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
var dateFormat = function () {
var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,
timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
timezoneClip = /[^-+\dA-Z]/g,
pad = function (val, len) {
Function retrieveJSON
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.retrieveJSON = function(url, data, fn) {
// allow jQuery.retrieveJSON(url, fn)
if ($.isFunction(data)) {
fn = data;
data = {};
File add2home.js
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Add to Homescreen v2.0 ~ Copyright (c) 2012 Matteo Spinelli, http://cubiq.org
* Released under MIT license, http://cubiq.org/license
*/
var addToHome = (function (w) {
Function fill
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
fill: function() {
var d = new Date(this.viewDate),
year = d.getFullYear(),
month = d.getMonth(),
currentDate = this.date.valueOf();
Function show
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show () {
var duration,
iPadXShift = 160;
// Set the initial position
File spin.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
//fgnass.github.com/spin.js#v1.2.5
(function(window, document, undefined) {
/**
* Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
File jquery.expander.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery Expander Plugin v1.4.3
*
* Date: Tue Jun 19 11:54:00 2012 EDT
* Requires: jQuery v1.3+
Function click
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
click: function(e) {
e.stopPropagation();
e.preventDefault();
var target = $(e.target).closest('span, td, th');
if (target.length == 1) {
Method index
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def index
@categories = AdCategory.where(parent_id: params[:category]||nil).asc(:name)
if params[:category]
@category = AdCategory.find(params[:category])
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 facebook_events
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.facebook_events(id)
graph = Koala::Facebook::API.new(Facebook::TOKEN)
events = graph.get_connections(id.to_s, "events").map do |event|
begin
event["start_time"] = event["start_time"] + "T21:00:00" if event["start_time"].length <= 10
- 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 loaded
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loaded () {
w.removeEventListener('load', loaded, false);
if ( !overrideChecks && (!isSafari || !isExpired || isSessionActive || isStandalone || !isReturningVisitor) ) return;
Function close
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function close () {
clearInterval( positionInterval );
clearTimeout( closeTimeout );
closeTimeout = null;
Method index
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
@categories = AdCategory.where(parent_id: params[:category]||nil).asc(:name)
if params[:category]
@category = AdCategory.find(params[:category])
end