Showing 81 of 2,641 total issues
Function initChart
has 29 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 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 normalizeGroup
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function normalizeGroup (data, key) {
var norm;
var min = Number.MAX_VALUE;
var max = -min;
data.forEach(function (group) {
Function tryFillSlot
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
tryFillSlot: function (facet) {
if (this.model.tryFillSlot(facet)) {
// Hack-ish feature:
// * for bubble plots, add a facet dropped as 'X axis' also as 'Point size'
// * for 3d scatter plots, add a facet dropped as 'X axis' also as 'Color by'
- 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 normalizeGroup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function normalizeGroup (data, key) {
var norm;
var min = Number.MAX_VALUE;
var max = -min;
data.forEach(function (group) {
- 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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function update (view) {
if (!view.isInitialized) {
return;
}
- 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 prettyPrintDuration
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prettyPrintDuration (tick) {
var parts = [];
var count;
var remainder = moment.duration(tick);
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (tickValue, index, ticks) {
// Find the proper tick spacing
// if we have lots of ticks, don't use the ones
var delta = Math.abs(ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0]);
Consider simplifying this complex logical expression. Open
if (navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/webOS/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/iPod/i) ||
Function startHelp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
startHelp: function () {
console.log(app.currentPage.helpTemplate);
console.log(app.currentPage.helpHints);
console.log(app.currentPage.helpSteps);
- 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 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"
Further reading
Function initChart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function initChart (view) {
// Configure plot
view._config = view.model.chartjsConfig();
var options = view._config.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 zenodoRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
zenodoRequest: async function(zenodoParams) {
var url_addition = zenodoParams.url_addition;
var requestType = zenodoParams.requestType;
var bodyData = zenodoParams.bodyData;
- 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
Consider simplifying this complex logical expression. Open
if (
(partitionA.isDatetime || partitionA.isDuration || partitionA.isContinuous) &&
(partitionB.isDatetime || partitionB.isDuration || partitionB.isContinuous)) {
if (partitionA.selected && partitionA.selected.length > 0) {
chartData.datasets[1] = chartData.datasets[1] || {
Consider simplifying this complex logical expression. Open
if ((e.x !== null && e.x !== undefined && !isNaN(e.x)) || (e.y !== null && e.y !== undefined && !isNaN(e.y))) {
errorBar.transition(easingDecimal).draw();
}
Consider simplifying this complex logical expression. Open
if (
(!app.currentPage.helpTemplate || app.currentPage.helpTemplate === '') &&
(!app.currentPage.helpHints || app.currentPage.helpHints() === []) &&
(!app.currentPage.helpSteps || app.currentPage.helpTemplate === [])
) {
Function addRawValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function addRawValue (string, raw) {
if (typeof string !== 'string' || string.length === 0) {
string = '';
} else {
string = string + ', ';
- 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 importJSON
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
importJSON: function () {
// var fileLoader = this.queryByHook('json-upload-input');
var fileLoader = document.getElementById('jsonuploadBtn');
var uploadedFile = fileLoader.files[0];
var reader = new window.FileReader();
- 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 tryFillSlot
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
tryFillSlot: function (facet, operation) {
var filter = this.collection.parent.filter;
if (!filter || this.isFilled) {
return false;
}
- 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"