Function renderContent
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderContent: function () {
var widgetNeedsData = false;
var el = document.getElementById('facetBar');
this._facetsSortable = sortablejs.create(el, {
File analyze.js
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
var app = require('ampersand-app');
var $ = require('jquery');
var PageView = require('./base');
var templates = require('../templates');
var WidgetFrameView = require('./analyze/widget-frame');
Function initializeCharts
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function initializeCharts (view) {
var gridster = view._widgetsGridster;
// BUGFIX: can sometimes get called before gridster is fully initialized
if (!gridster) {
- 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 addWidgetForFilter
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addWidgetForFilter (view, filter, editModeHint) {
var gridster = view._widgetsGridster;
var row = filter.row || 1;
var col = filter.col || 1;
var sizeX = filter.size_x || 3;
Function initializeCharts
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initializeCharts (view) {
var gridster = view._widgetsGridster;
// BUGFIX: can sometimes get called before gridster is fully initialized
if (!gridster) {
Function renderContent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
renderContent: function () {
var widgetNeedsData = false;
var el = document.getElementById('facetBar');
this._facetsSortable = sortablejs.create(el, {
- 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 addWidgetForFilter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function addWidgetForFilter (view, filter, editModeHint) {
var gridster = view._widgetsGridster;
var row = filter.row || 1;
var col = filter.col || 1;
var sizeX = filter.size_x || 3;
- 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"