Showing 269 of 3,565 total issues
Function getHighlightAttrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getHighlightAttrs: function (node, model, filter) {
const config = node.config;
const guide = config.guide;
const screenModel = node.screenModel;
const showOnHover = node.config.guide.showAnchors === 'hover';
- 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 _expandUnitsStructure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_expandUnitsStructure(root: Unit, parentPipe: DataFilter[] = []) {
var self = this;
if (root.expression.operator === 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"
Further reading
Avoid deeply nested control flow statements. Open
for (i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
Avoid deeply nested control flow statements. Open
if (h.from > g.from && h.from <= g.to) {
h.from--;
}
Function cross_period
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
dataFn: () => any[],
dimX: string,
dimY: string,
xPeriod: string,
yPeriod: string,
Consider simplifying this complex logical expression. Open
if (
(!isAuto && config.guide.x.fillGaps) ||
(isAuto && (isStack || (xPeriod && isYValue)))
) {
return GrammarRegistry.get('fillGaps')(model, {
Consider simplifying this complex logical expression. Open
if (firstUnit.type === 'ELEMENT.INTERVAL' &&
(prop === 'y') === Boolean(firstUnit.flip) &&
firstUnit.label &&
!chart.getScaleInfo(firstUnit.label, frame).isEmpty()
) {
Function splitCubicSegment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function splitCubicSegment(t: number, p0: Point, c0: Point, c1: Point, p1: Point) {
Function splitCurveSegment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function splitCurveSegment(t: number, p0: Point, c0: Point, c1: Point, p1: Point) {
Function getStepLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getStepLine(points: Point[]) {
var result: Point[] = [];
var hasId = (points[0].id !== undefined);
var hasSize = (points[0].size !== undefined);
for (var i = 1, p0, p1, m0, m1; i < points.length; i++) {
- 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 getStepAfterLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getStepAfterLine(points: Point[]) {
var result: Point[] = [];
var hasId = (points[0].id !== undefined);
var hasSize = (points[0].size !== undefined);
for (var i = 1, p0, p1, m; i < points.length; i++) {
- 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 fetchJson
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function fetchJson(url, callback) {
const req = new XMLHttpRequest();
req.onload = () => {
if (req.status >= 200 && req.status < 300) {
const text = req.responseText;
- 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 start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
start(nIterations) {
// main simulated annealing function
var ti = 1.0;
const t0 = 1.0;
const itemsLength = this.items.length;
- 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 getStepBeforeLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getStepBeforeLine(points: Point[]) {
var result: Point[] = [];
var hasId = (points[0].id !== undefined);
var hasSize = (points[0].size !== undefined);
for (var i = 1, p0, p1, m; i < points.length; i++) {
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
create(interval: [number, number]) {
var props = this.scaleConfig;
var varSet = this.vars;
- 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 ChartParallel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const ChartParallel = (config: ParallelConfig) => {
var guide = Object.assign({columns: {}}, (config.guide as ChartConfig) || {});
var scales = {};
- 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 ChartMap
has a Cognitive Complexity of 7 (exceeds 5 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'});
- 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 getHighlightAttrs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getHighlightAttrs: function (node, model, filter) {
const config = node.config;
const guide = config.guide;
const screenModel = node.screenModel;
const showOnHover = node.config.guide.showAnchors === 'hover';
- 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 _getBoundsInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getBoundsInfo(this: GrammarElement, dots: Element[]) {
if (dots.length === 0) {
return null;
}
- 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 x-num-auto
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
'x-num-auto': function (x) {
if (isNaN(x)) {
return 'NaN';
}
var abs = Math.abs(x);
- 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"