Showing 269 of 3,565 total issues
File layer-labels.ts
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utilsDraw from '../../utils/utils-draw';
import * as utilsDom from '../../utils/utils-dom';
import * as utils from '../../utils/utils';
import {LayerLabelsModel} from './layer-labels-model';
import {LayerLabelsRules} from './layer-labels-rules';
Function draw
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw(fibers: any[][]) {
var self = this;
var model = this.model;
Function deepClone
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
var deepClone = (function () {
// clone objects, skip other types.
function clone(target) {
if (typeof target == '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 transform
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
transform(chart: Plot) {
var specRef = this.spec;
if (!this.isApplicable) {
File element.path.base.js
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {LayerLabels} from './decorators/layer-labels';
import {CSS_PREFIX} from '../const';
import {
d3_animationInterceptor,
d3_setAttrs as attrs,
Function deepClone
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
var deepClone = (function () {
// clone objects, skip other types.
function clone(target) {
if (typeof target == 'object') {
Function draw
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw() {
const node = this.node();
const config = node.config;
const guide = config.guide;
const options = config.options;
Function calcXYGuide
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
function calcXYGuide(
guide: UnitGuide,
settings: ChartSettings,
xMeta,
yMeta,
Function scalesPool
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
scalesPool(scaleType: string, dimName: string, guide: ScaleGuide, settings: ChartSettings) {
var k = `${scaleType}_${dimName}`;
if (this.dist.scales.hasOwnProperty(k)) {
Function _pickPlace
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
_pickPlace(target) {
if (!this.options.auto) {
return this.options.place;
}
const winBound = 0 | this.options.winBound;
- 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 draw
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw() {
const node = this.node();
const config = node.config;
const options = config.options;
// TODO: hide it somewhere
Function _getBoundsInfo
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getBoundsInfo(this: GrammarElement, dots: Element[]) {
if (dots.length === 0) {
return null;
}
File spec-transform-calc-size.ts
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from './utils/utils';
import {SpecTransformOptimize} from './spec-transform-optimize';
import {DataFrame} from './data-frame';
import {
ChartSettings,
File d3-decorators.js
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from './utils';
import * as utilsDom from './utils-dom';
import * as utilsDraw from './utils-draw';
import * as d3Selection from 'd3-selection';
import * as d3Transition from 'd3-transition';
Function draw
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
draw(fibers: any[][]) {
var self = this;
var model = this.model;
- 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 element.point.ts
has 341 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 * as utils from '../utils/utils';
import * as utilsDom from '../utils/utils-dom';
File utils-dom.ts
has 338 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Internal method to return CSS value for given element and property
*/
import * as d3 from 'd3-selection';
var tempDiv = document.createElement('div');
File element.area.ts
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as d3Color from 'd3-color';
import * as d3Selection from 'd3-selection';
const d3 = {
...d3Color,
...d3Selection,
Function getCubicInterpolator
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCubicInterpolator(pointsFrom: XPoint[], pointsTo: XPoint[]) {
for (var i = 2; i < pointsFrom.length - 1; i += 3) {
pointsFrom[i - 1].isCubicControl = true;
pointsFrom[i].isCubicControl = true;
File spec-converter.ts
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from './utils/utils';
import {UnitDomainPeriodGenerator} from './unit-domain-period-generator';
import {
ChartConfig,
ChartSettings,