Showing 269 of 3,565 total issues
Function getCubicSpline
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCubicSpline(points: Point[], limited: boolean): Point[] {
if (points.length < 2) {
return points.slice(0);
}
if (points.length === 2) {
Function merged
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
.call(function (selection) {
var node = selection;
node.attr('class', 'map-container');
Function sortChildren
has 96 lines of code (exceeds 25 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
Function init
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(xConfig) {
const config = Object.assign({}, xConfig);
config.guide = (config.guide || {});
Function drawFrames
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawFrames() {
var self = this;
var options = this.config.options;
Function avoidTickTextCollision
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function avoidTickTextCollision(ticks, isHorizontal) {
const textOffsetStep = 11;
const refOffsetStart = isHorizontal ? -10 : 20;
const translateParam = isHorizontal ? 0 : 1;
Function getClosestElement
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
getClosestElement(cursorX: number, cursorY: number) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._boundsInfo as BoundsInfo;
Function extractFieldsFormatInfo
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
static extractFieldsFormatInfo(spec: GPLSpec) {
var specScales = spec.scales;
var isEmptyScale = function (key: string) {
Function constructor
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(config) {
super(config);
this.config = config;
Function calcXYGuide
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function calcXYGuide(
guide: UnitGuide,
settings: ChartSettings,
xMeta,
yMeta,
- 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 init
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(xConfig) {
const config = Object.assign({}, xConfig);
config.guide = utils.defaults(
File tau.charts.ts
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utilsDom from './utils/utils-dom';
import * as utils from './utils/utils';
import * as utilsDraw from './utils/utils-draw';
import {GPL} from './charts/tau.gpl';
import {Plot} from './charts/tau.plot';
Function draw
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw(this: PointInstance) {
const node = this.node() as PointClass;
const config = node.config;
const options = config.options;
Function autoPosition
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
autoPosition(parallel: Parallel, tokens: string[]) {
const calcEllipticXY = (r, angle) => {
const xReserve = 4;
const yReserve = 2;
Function autoDetectDimTypes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
autoDetectDimTypes: function (data: any[]): ChartDimensionsMap {
var defaultDetect = {
type: 'category',
scale: 'ordinal'
- 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 ChartArea
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChartArea = (rawConfig: ChartConfig) => {
var config = normalizeConfig(rawConfig);
var data = config.data;
File coords.cartesian.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {Element} from './element';
import * as utilsDom from '../utils/utils-dom';
import * as utilsDraw from '../utils/utils-draw';
import * as utils from '../utils/utils';
import {CSS_PREFIX} from '../const';
Function getLinearInterpolator
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getLinearInterpolator(pointsFrom: XPoint[], pointsTo: XPoint[]): (t: number) => XPoint[] {
// TODO: Continue unfinished transition of ending points.
pointsFrom = pointsFrom.filter(d => !d.isInterpolated);
Function getFacetCount
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var getFacetCount = (specRef: GPLSpec) => {
var xFacetKeys: string[] = [];
var yFacetKeys: string[] = [];
var getFacetKeys = (root: Unit) => {
// TODO: Maybe there is an API to
- 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 tau.gpl.ts
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {Emitter} from '../event';
import * as utils from '../utils/utils';
import {FramesAlgebra} from '../algebra';
import {DataFrame} from '../data-frame';
import {