app/assets/javascripts/pizzade.js
Function hipster
has a Cognitive Complexity of 128 (exceeds 5 allowed). Consider refactoring. Open
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
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
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
Open
function replay(items, finishCallback) {
// setup
my.log('replay: setup started');
$.fx.off = true;
$('body').addClass('wait');
Function addItemsToBasket
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 replayData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
replayData: function() {
var data = window.hipsterReplayData;
var mode = window.hipsterReplayMode;
if(typeof data === 'undefined' || data === null) {
return;