Showing 6 of 13 total issues
Function exports
has 78 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 beforeUpdate
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
beforeUpdate: function(chart, args, options) {
// Please note that in v3, the args argument was added. It was not used before it was added,
// so we just check if it is not actually our options object
if (options === undefined) {
options = args;
File colorschemes.brewer.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
// eslint-disable-next-line one-var
export var
// Sequential
Function afterUpdate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
afterUpdate: function(chart) {
// Unset colors
chart.config.data.datasets.forEach(function(dataset) {
if (dataset[EXPANDO_KEY]) {
if (dataset[EXPANDO_KEY].hasOwnProperty('backgroundColor')) {
- 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 beforeUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
beforeUpdate: function(chart, args, options) {
// Please note that in v3, the args argument was added. It was not used before it was added,
// so we just check if it is not actually our options object
if (options === undefined) {
options = args;
- 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 getScheme
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getScheme(scheme) {
var colorschemes, matches, arr, category;
if (helpers.isArray(scheme)) {
return scheme;
- 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"