Showing 19 of 19 total issues
Function hipster
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
var hipster = window.hipster = (function() {
'use strict';
var my = HIPSTER;
- 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 hipster
has 510 lines of code (exceeds 25 allowed). Consider refactoring. Open
var hipster = window.hipster = (function() {
'use strict';
var my = HIPSTER;
File pizzade.js
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
//= require jquery_ujs
//= require _both
//= require bootstrap/dropdown
//= require bootstrap/collapse
//= require _static_tools
Function replay
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
function replay(items, finishCallback) {
// setup
my.log('replay: setup started');
$.fx.off = true;
$('body').addClass('wait');
Class Basket
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Basket < ActiveRecord::Base
extend FriendlyId
friendly_id :uid
has_many :orders, dependent: :destroy
Function addItemsToBasket
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addItemsToBasket() {
my.log('replay: searching page “' + getActiveSubPageText() + '” for items');
items = $.grep(items, function (item, ind) {
// Deposit is added automatically when selecting the correct products
Function HIPSTER
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var HIPSTER = (function (my) {
'use strict';
// PRIVATE ///////////////////////////////////////////////////////////////////
// PUBLIC ////////////////////////////////////////////////////////////////////
- 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 HIPSTER
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HIPSTER = (function (my) {
'use strict';
// PRIVATE ///////////////////////////////////////////////////////////////////
Function replayData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
replayData: function() {
var data = window.hipsterReplayData;
var mode = window.hipsterReplayMode;
if(typeof data === 'undefined' || data === null) {
return;
Function HIPSTER
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var HIPSTER = (function (my) {
'use strict';
// PRIVATE ///////////////////////////////////////////////////////////////////
- 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 HIPSTER
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var HIPSTER = (function (my) {
'use strict';
// PRIVATE ///////////////////////////////////////////////////////////////////
// PUBLIC ////////////////////////////////////////////////////////////////////
Method create_uid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_uid
raise "Basket has already an UID" if self.uid
other = Basket.pluck(:uid)
- 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 HIPSTER
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var HIPSTER = (function (my) {
'use strict';
my.Watchdog = function(timeout, callback) {
if(typeof(callback) !== 'function') {
- 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 cookie_set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cookie_set(key, value, perma = true)
key = key.to_s
raise "invalid cookie key: #{key}" unless cookie_valid_key?(key)
key = "_hipsterpizza_#{key}"
- 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 new
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def new
# if there’s an editable basket and we are in single basket mode,
# redirect directly to basket instead of creating new one
if PINNING['single_basket_mode']
@basket = Basket.find_editable
- 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 contact_details_array
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def contact_details_array
def get(f)
contact_field(f) || ''
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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def destroy
unless view_context.my_order? || view_context.admin?
flash[:warn] = I18n.t('order.controller.destroy.admin_required')
return redirect_to @basket
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 find_basket
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_basket
basket_id = params[:basket_id] || params[:id]
@basket ||= Basket.friendly.find(basket_id.downcase) rescue nil
# if there’s an id, but it’s invalid it should ignore the cookie. This
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
old_pay = @order.paid? ? @order.sum : 0
old_pay_tip = @order.paid? ? @order.sum_with_tip : 0
@order.json = params[:json]
- 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"