Showing 21 of 40 total issues
Function query
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function query(obj, expr) {
var regex = /(?:,|^)\s*(?:"([^"]*)"|'([^']*)'|([^,\s]*))/gi;
var result = [];
var matches, bracketKey, dotKey, nextExprWithDot, nextExpr, quotedKey, subset, i, ilen, keys;
- 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 convert
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var workbook = XLSX.read(new Uint8Array(input), {type: 'array'});
var dataRange = parseExpression(workbook, datasourceHelpers.valueOrDefault(options.data, ''));
- 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 convert
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var arrays = csvToArrays(input, options.delimiter);
var datasets = [];
- 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 exports
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(karma) {
const args = karma.args || {};
const regex = args.watch ? /\.js$/ : /\.min\.js$/;
const build = builds.filter((v) => v.output.file.match(regex))[0];
Function mergeData
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function mergeData(target, source) {
var sourceDatasets = source.datasets;
var targetDatasets = target.datasets;
var sourceLabels = source.labels;
var targetLabels = target.labels;
- 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 convert
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var workbook = XLSX.read(new Uint8Array(input), {type: 'array'});
var dataRange = parseExpression(workbook, datasourceHelpers.valueOrDefault(options.data, ''));
Function convert
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var datasets = [];
var datasetLabels, indexLabels, data, arrays, i, ilen;
- 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 convert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var datasets = [];
var datasetLabels, indexLabels, data, arrays, i, ilen;
Function convert
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert: function(input) {
var me = this;
var options = me._options;
var arrays = csvToArrays(input, options.delimiter);
var datasets = [];
Function csvToArrays
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function csvToArrays(str, delimiter) {
var regex = new RegExp('(' + delimiter +
'|\r?\n(?!$)|\r(?!$)|^(?!$))(?:"((?:\\.|""|[^\\"])*)"|([^' + delimiter + '"\r\n]*))', 'gi');
var array = [];
var arrays = [array];
- 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 query
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function query(sheetRange, options) {
var sheet = sheetRange.sheet;
var range = sheetRange.range;
var r = options && options.columnOriented ? 'c' : 'r';
var c = options && options.columnOriented ? 'r' : 'c';
- 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 getPointData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function getPointData(arrays, datasetLabels, datapointLabelMapping) {
var keys = Object.keys(datapointLabelMapping);
var datapointLabelLookup = {};
var datasetLabelLookup = {};
var result = [];
- 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 parseExpression
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function parseExpression(workbook, expr) {
var matches, sheetName, sheet, rangeExpr, ref, range, refRange;
while (expr) {
if (expr.match(/^(([A-Z]+\d*|[A-Z]*\d+):([A-Z]+\d*|[A-Z]*\d+)|[A-Z]+\d+)$/)) {
- 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 query
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function query(obj, expr) {
var regex = /(?:,|^)\s*(?:"([^"]*)"|'([^']*)'|([^,\s]*))/gi;
var result = [];
var matches, bracketKey, dotKey, nextExprWithDot, nextExpr, quotedKey, subset, i, ilen, keys;
Function mergeData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mergeData(target, source) {
var sourceDatasets = source.datasets;
var targetDatasets = target.datasets;
var sourceLabels = source.labels;
var targetLabels = target.labels;
Function parseExpression
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseExpression(workbook, expr) {
var matches, sheetName, sheet, rangeExpr, ref, range, refRange;
while (expr) {
if (expr.match(/^(([A-Z]+\d*|[A-Z]*\d+):([A-Z]+\d*|[A-Z]*\d+)|[A-Z]+\d+)$/)) {
Function getPointData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPointData(arrays, datasetLabels, datapointLabelMapping) {
var keys = Object.keys(datapointLabelMapping);
var datapointLabelLookup = {};
var datasetLabelLookup = {};
var result = [];
Function getPointData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getPointData(arrays, datasetLabels, datapointLabels) {
var lookup = {};
var result = [];
var array, obj, datapointLabel, datapointValue, i, j, ilen, jlen;
- 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 getPointData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getPointData(arrays, datasetLabels, datapointLabels) {
var lookup = {};
var result = [];
var array, obj, datapointLabel, datapointValue, i, j, ilen, jlen;
- 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
Avoid too many return
statements within this function. Open
return result.length > 1 ? result : result[0];