Showing 81 of 2,641 total issues
Consider simplifying this complex logical expression. Open
if (i >= 0 && j >= 0 && group.aa !== misval && group.bb !== misval && group.count !== 0) {
// initialize if necessary
chartData.datasets[0].data[d] = chartData.datasets[0].data[d] || {};
chartData.datasets[0].error[d] = chartData.datasets[0].error[d] || {};
Function draw
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function () {
var ctx = this._chart.ctx;
var vm = this._view;
if (vm.direction === 'none') {
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
// Reset the CSV parsing dialog.
// NOTE: we could do this via bindings, but this is easier (less code)
this.renderWithTemplate(this);
this.query('#CSV-header-columns').checked = app.CSVHeaders;
Function fn
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
fn: function () {
var filter = this.collection.parent.filter;
// stop accepting DND
if (this._sortable) {
- 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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render: function () {
// Reset the CSV parsing dialog.
// NOTE: we could do this via bindings, but this is easier (less code)
this.renderWithTemplate(this);
this.query('#CSV-header-columns').checked = app.CSVHeaders;
- 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 startWelcome
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
startWelcome: function () {
var welcome = Help();
welcome.setOption('tooltipClass', 'welcome-dialog');
welcome.setOptions({
'showStepNumbers': false,
Function exportData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exportData: function () {
var chartsData = [];
var partitionRankToName = {1: 'a', 2: 'b', 3: 'c', 4: 'd'};
var aggregateRankToName = {1: 'aa', 2: 'bb', 3: 'cc', 4: 'dd', 5: 'ee'};
Function updateErrorBar
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateErrorBar: function updateErrorBar (errorBar, element, index, reset) {
var dataset = this.getDataset();
var meta = this.getMeta();
var xScale = this.getScaleForId(meta.xAxisID);
var yScale = this.getScaleForId(meta.yAxisID);
Function drawGraph
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawGraph (view) {
var filter = view.model.filter;
var edgeToCount = {};
var count;
var type;
Function onload
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
reader.onload = function (ev) {
app.message({
text: 'Processing',
type: 'ok'
});
Function initialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
initialize: function () {
var filter = this.collection.parent.filter;
this.model.isFilled = false;
if (filter) {
- 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 rotateSetting
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
rotateSetting: function () {
var filter = this.collection.parent.filter;
filter.releaseDataFilter();
if (this.model.type === 'partition') {
- 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 initChart
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initChart (view) {
// Configure plot
view._config = view.model.chartjsConfig();
var options = view._config.options;
Function buildLabelDiffs
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildLabelDiffs: function () {
var me = this;
me.labelDiffs = [];
var scaleLabelDiffs = [];
// Parse common labels once
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 initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
this.slots.reset([
{
description: 'Group by',
type: 'partition',
Function initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
this.slots.reset([
{
description: 'X axis',
type: 'partition',
Function initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
this.slots.reset([
{
description: 'Group by',
type: 'partition',
Function tryFillSlot
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
tryFillSlot: function (facet, operation) {
var filter = this.collection.parent.filter;
if (!filter || this.isFilled) {
return false;
}
Function importRemoteSession
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
importRemoteSession: function (sessionUrl) {
// console.log('app.js: Getting the remote session.');
var that = this;
app.busy({enable: true});