Showing 269 of 3,565 total issues
Function constructor
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
constructor(xSource: DataFrame, scaleConfig: ScaleConfig) {
super(xSource, scaleConfig);
var props = this.scaleConfig;
- 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 interpolateEnding
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function interpolateEnding({t, polyline, decreasing, rightToLeft}) {
var reverse = Boolean(decreasing) !== Boolean(rightToLeft);
var result = (function getLinePiece(t, line) {
- 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 value
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
value: function (target) {
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
- 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 interpolateCubicEnding
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function interpolateCubicEnding({t, polyline, decreasing, rightToLeft}) {
var reverse = Boolean(decreasing) !== Boolean(rightToLeft);
var result = (function getLinePiece(t, line) {
- 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 constructor
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(dataFrame: DataFrame, scaleConfig: ScaleConfig) {
this._fields = {};
var data;
Function ChartParallel
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChartParallel = (config: ParallelConfig) => {
var guide = Object.assign({columns: {}}, (config.guide as ChartConfig) || {});
var scales = {};
Function _displayTimeoutWarning
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_displayTimeoutWarning({proceed, cancel, timeout}: {proceed: () => void, cancel: () => void, timeout: number}) {
var width = 200;
var height = 100;
var linesCount = 3;
var lineSpacing = 1.5;
Function defineGrammarModel
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
defineGrammarModel(fnCreateScale: ScaleFactoryMethod): GrammarModel {
const config = this.config;
this.regScale('x', fnCreateScale('pos', config.x, [0, config.options.width]))
.regScale('y', fnCreateScale('pos', config.y, [config.options.height, 0]))
.regScale('y', fnCreateScale(
Function getClosestElement
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
getClosestElement(_cursorX, _cursorY) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._boundsInfo;
Function BUILD-GUIDE
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
'BUILD-GUIDE': (srcSpec, meta, settings) => {
var spec = utils.clone(srcSpec);
fnTraverseSpec(
utils.clone(spec.unit),
Function _drawGrid
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_drawGrid(container, node, width, height) {
var grid = selectOrAppend(container, `g.grid`)
.attr('transform', utilsDraw.translate(0, 0))
.call((selection) => {
- 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 entire-view
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
'entire-view'(srcSize, calcSize, specRef, tryOptimizeSpec) {
var g = specRef.unit.guide;
var {xFacetCount, yFacetCount} = getFacetCount(specRef);
if (yFacetCount > 0) {
- 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 getClosestElement
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
getClosestElement(cursorX: number, cursorY: number) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._boundsInfo as BoundsInfo;
- 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 buildModel
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildModel(screenModel) {
const config = this.node().config;
const guide = config.guide;
const options = config.options;
Function wrapText
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
var wrapText = (textNode, getScaleStepSize, linesLimit, tickLabelFontHeight, isY, getComputedTextLength) => {
getComputedTextLength = getComputedTextLength || d3getComputedTextLength();
var addLine = (targetD3, text, lineHeight, x, y, dy, lineNumber) => {
Function energy
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
var energy = function (index) {
// energy function, tailored for label placement
var m = lab.length,
ener = 0,
Function getScaleDiffFn
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getScaleDiffFn(points1, points2) {
// Find remaining points with predictable position
var src = [];
var dst = [];
Function ChartMap
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChartMap = (config: MapConfig) => {
let guide = Object.assign({sourcemap: config.settings.defaultSourceMap}, (<MapGuide>config.guide) || {});
guide.size = utils.defaults(guide.size || {}, {min: 1, max: 10});
guide.code = utils.defaults(guide.code || {}, {georole: 'countries'});
Function exports
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
const DEBUG = Boolean(config.tauchartsDebug);
config.set({
Function BUILD-COMPACT
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
'BUILD-COMPACT': (srcSpec, meta, settings) => {
var spec = utils.clone(srcSpec);
fnTraverseSpec(
utils.clone(spec.unit),