Showing 81 of 2,641 total issues
Function exports
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (Chart, moment) {
var helpers = Chart.helpers;
moment = moment || require('moment');
var DurationScale = Chart.Scale.extend({
- 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
File app.js
has 589 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Spot = require('spot-framework');
var app = require('ampersand-app');
var Router = require('./router');
var MainView = require('./pages/main');
var DatasetsView = require('./pages/datasets');
Function exports
has 231 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Chart, moment) {
var helpers = Chart.helpers;
moment = moment || require('moment');
var DurationScale = Chart.Scale.extend({
Function exports
has 159 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Chart, chartType, newType) {
var helpers = Chart.helpers;
// ErrorBar element
Chart.elements.ErrorBar = Chart.elements.ErrorBar || Chart.Element.extend({
Function resizeChartjsData
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
function resizeChartjsData (chartData, partitionA, partitionB, options) {
var x = partitionA ? partitionA.groups.length : 1;
var y = partitionB ? partitionB.groups.length : 1;
options = options || {};
- 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 update
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update (view) {
if (!view.isInitialized) {
return;
}
Function prettyPrintDuration
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function prettyPrintDuration (tick) {
var parts = [];
var count;
var remainder = moment.duration(tick);
- 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 updateBubbles
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateBubbles (view) {
var filter = view.model.filter;
var chartData = view._config.data;
var partitionA = filter.partitions.get(1, 'rank');
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 datasets.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Spot = require('spot-framework');
var PageView = require('./base');
var templates = require('../templates');
var app = require('ampersand-app');
var $ = require('jquery');
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 update
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update (view) {
if (!view.isInitialized) {
return;
}
Function resizeChartjsData
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resizeChartjsData (chartData, partitionA, partitionB, options) {
var x = partitionA ? partitionA.groups.length : 1;
var y = partitionB ? partitionB.groups.length : 1;
options = options || {};
Function update
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update (view) {
if (!view.isInitialized) {
console.warn('Cannot update chart, not initialized', view);
return;
}
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
File chartjs-duration-scale.js
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global window: false */
'use strict';
var moment = require('moment-timezone');
function prettyPrintDuration (tick) {
`` has 25 functions (exceeds 20 allowed). Consider refactoring. Open
app.extend({
/**
* [fullscreenMode description]
* @type {Boolean}
*/
Function initChart
has 69 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 importCSV
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
importCSV: function () {
// var fileLoader = this.queryByHook('csv-upload-input');
var fileLoader = document.getElementById('csvuploadBtn');
var uploadedFile = fileLoader.files[0];
var reader = new window.FileReader();
Function updateBubbles
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function updateBubbles (view) {
var filter = view.model.filter;
var chartData = view._config.data;
var partitionA = filter.partitions.get(1, 'rank');
- 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"