Showing 81 of 2,641 total issues
Function zenodoRequest
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
zenodoRequest: async function(zenodoParams) {
var url_addition = zenodoParams.url_addition;
var requestType = zenodoParams.requestType;
var bodyData = zenodoParams.bodyData;
Function update
has a Cognitive Complexity of 19 (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 buildTicks
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildTicks: function () {
var me = this;
me.ctx.save();
var tickFontSize = helpers.getValueOrDefault(me.options.ticks.fontSize, Chart.defaults.global.defaultFontSize);
Function uploadSessionZenodo
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadSessionZenodo: function () {
var that = this;
var json = app.me.toJSON();
Function initChart
has a Cognitive Complexity of 18 (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 importJSON
has 58 lines of code (exceeds 25 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();
Function exports
has a Cognitive Complexity of 17 (exceeds 5 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({
- 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 chartjsConfig
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
chartjsConfig: function () {
return {
type: 'bubbleError',
data: {
datasets: []
File chartjs2d.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
var app = require('ampersand-app');
var Spot = require('spot-framework');
var BaseWidget = require('./base-widget');
var Chart = require('chart.js');
var colors = require('../../colors');
exports
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
module.exports = PageView.extend({
template: templates.datasets.page,
initialize: function () {
this.pageName = 'datasets';
this.helpTemplate = '';
Function chartjsConfig
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
chartjsConfig: function () {
return {
type: 'lineError',
data: {
datasets: [],
Function chartjsConfig
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
chartjsConfig: function () {
return {
type: 'horizontalBarError',
data: {
datasets: [],
Function initChart
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initChart (view) {
// Configure plot
view._config = view.model.scatterConfig();
var filter = view.model.filter;
Function initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
this.slots.reset([
{
description: 'X axis',
type: 'partition',
Function chartjsConfig
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
chartjsConfig: function () {
return {
type: 'barError',
data: {
datasets: [],
Function initialize
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function () {
this.slots.reset([
{
description: 'X axis',
type: 'partition',
Function onload
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
reader.onload = function (ev) {
app.message({
text: 'Processing',
type: 'ok'
});
Function startHelp
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
startHelp: function () {
console.log(app.currentPage.helpTemplate);
console.log(app.currentPage.helpHints);
console.log(app.currentPage.helpSteps);
Function determineDataLimits
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
determineDataLimits: function () {
var me = this;
me.labelMoments = [];
// Get min max from labels
Function update
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function update (view) {
if (!view.isInitialized) {
console.warn('Cannot update chart, not initialized', view);
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"