Showing 269 of 3,565 total issues
Function createAxis
has 440 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createAxis(config: AxisConfig) {
const orient = Orient[config.scaleGuide.scaleOrient];
const scale = config.scale;
const scaleGuide = config.scaleGuide;
File tau.plot.ts
has 796 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {Balloon} from '../api/balloon';
import {Emitter, EventHandlerMap} from '../event';
import {Plugins} from '../plugins';
import * as utils from '../utils/utils';
import * as utilsDom from '../utils/utils-dom';
File utils.ts
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as d3Array from 'd3-array';
import * as d3Scale from 'd3-scale';
const d3 = {
...d3Array,
...d3Scale,
Function d3Labeler
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
var d3Labeler = function () {
var lab = [],
anc = [],
w = 1, // box width
h = 1, // box width
- 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
File spec-transform-auto-layout.ts
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from './utils/utils';
import {FormatterRegistry} from './formatter-registry';
import * as d3 from 'd3-scale';
import {
ChartSettings,
File path-points.ts
has 606 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from '../../utils';
import {getBezierPoint, splitCubicSegment as split} from '../bezier';
import {Point} from '../point';
interface XPoint extends Point {
Plot
has 65 functions (exceeds 20 allowed). Consider refactoring. Open
export class Plot extends Emitter {
protected _nodes: GrammarElement[];
protected _svg: SVGSVGElement;
protected _filtersStore: {
Function d3Labeler
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
var d3Labeler = function () {
var lab = [],
anc = [],
w = 1, // box width
h = 1, // box width
Function scalesPool
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
scalesPool(scaleType: string, dimName: string, guide: ScaleGuide, settings: ChartSettings) {
var k = `${scaleType}_${dimName}`;
if (this.dist.scales.hasOwnProperty(k)) {
- 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 transform
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
transform(chart: Plot) {
var specRef = this.spec;
if (!this.isApplicable) {
- 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 _drawMap
has 219 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawMap(frames, topoJSONData) {
var self = this;
var guide = this.config.guide;
File coords.cartesian.axis.ts
has 516 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {defaults, take, normalizeAngle} from '../utils/utils';
import {selectOrAppend, classes} from '../utils/utils-dom';
import {cutText, wrapText, avoidTickTextCollision} from '../utils/d3-decorators';
import {CSS_PREFIX} from '../const';
import * as utilsDraw from '../utils/utils-draw';
Function sortChildren
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export function sortChildren(parent: Element, sorter: (a: Element, b: Element) => number) {
if (parent.childElementCount > 0) {
// Note: move DOM elements with
// minimal number of iterations
- 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
File grammar-registry.ts
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from './utils/utils';
import {UnitDomainPeriodGenerator} from './unit-domain-period-generator';
import {TauChartError as Error, errorCodes} from './error';
import {
GrammarModel,
Function buildModel
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
buildModel(screenModel, {prettify, minBarH, minBarW, baseCssClass}) {
const barSize = ((d) => {
var w = screenModel.size(d);
if (prettify) {
- 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
File layer-labels-rules.ts
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {LayerLabelsModel, LayerLabelsModelObj} from './layer-labels-model';
import {ScaleFunction} from '../../definitions';
import {hasXOverflow, hasYOverflow} from '../../utils/utils';
var rules: {[alias: string]: LabelRule} = {};
File element.interval.js
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {CSS_PREFIX} from '../const';
import {GrammarRegistry} from '../grammar-registry';
import {LayerLabels} from './decorators/layer-labels';
import {
d3_animationInterceptor,
File coords.geomap.js
has 438 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as d3Array from 'd3-array';
import * as d3Geo from 'd3-geo';
import * as d3Selection from 'd3-selection';
import fetchJson from '../utils/fetchJson';
const d3 = {
Function getCubicSpline
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function getCubicSpline(points: Point[], limited: boolean): Point[] {
if (points.length < 2) {
return points.slice(0);
}
if (points.length === 2) {
- 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 42 (exceeds 5 allowed). Consider refactoring. Open
value: (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
- 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"