Showing 269 of 3,565 total issues
Function drawFrames
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawFrames(frames) {
var cfg = Object.assign({}, this.config);
var options = cfg.options;
Function _getBoundsInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getBoundsInfo(this: PointInstance, dots: Element[]) {
if (dots.length === 0) {
return null;
}
Function autoDetectDimTypes
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
autoDetectDimTypes: function (data: any[]): ChartDimensionsMap {
var defaultDetect = {
type: 'category',
scale: 'ordinal'
Function create
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(interval) {
const gen = this.periodGenerator;
var varSet = this.vars;
Function selectOrAppend
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function selectOrAppend(_container: Element | d3Selection, selector: string) {
var delimitersActions = {
'.': (text, el) => el.classed(text, true),
'#': (text, el) => el.attr('id', text)
};
Function interpolated
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const interpolated = (() => {
interface Pair {
start: ElementInfo;
end: ElementInfo;
y: number;
Function method
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
((model) => {
const dataSource = model.data();
const xColors = dataSource
.reduce((map, row) => {
const x = row[model.scaleX.dim];
Function xml
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function xml(tag: string) {
var childrenArgIndex = 2;
var attrs = arguments[1];
if (typeof arguments[1] !== 'object' || Array.isArray(arguments[1])) {
childrenArgIndex = 1;
Function mcmove
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var mcmove = function (currT) {
// Monte Carlo translation move
// select a random label
var i = Math.floor(Math.random() * lab.length);
Function _drawGrid
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawGrid(container, node, width, height) {
var grid = selectOrAppend(container, `g.grid`)
.attr('transform', utilsDraw.translate(0, 0))
.call((selection) => {
Function _handlePointerEvent
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handlePointerEvent(event: MouseEvent) {
// TODO: Highlight API seems not consistent.
// Just predicate is not enough, also
// need coordinates or event object.
const svgRect = this._svg.getBoundingClientRect();
Function reg
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
reg(unitType: string, xUnit: GrammarElement | ElementConsructor, xSeed?: string) {
if (xSeed) {
SeedsMap[unitType] = xSeed;
UnitsMap[unitType] = <ElementConsructor><any>function (config, Base) {
Function hideOnLabelLabelOverlap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
hideOnLabelLabelOverlap(data: TextInfo[]) {
var extremumOrder = {min: 0, max: 1, norm: 2};
var collisionSolveStrategies = {
'min/min': ((p0, p1) => p1.y - p0.y), // desc
Function fixOuterTicksOverflow
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fixOuterTicksOverflow(text: d3Selection) {
if (values.length === 0) {
return;
}
Function highlightDataPoints
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
highlightDataPoints(filter) {
const node = this.node();
const elModel = this.domElementModel;
const dots = highlightAnchors(node, elModel, filter);
const container = node.config.options.container;
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
getClosestElement(cursorX, cursorY) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._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 get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
get: (formatAlias: string | ((x: any) => string) , nullOrUndefinedAlias?: string) => {
var formatter = null;
if (typeof formatAlias === `function`) {
formatter = formatAlias;
} else {
- 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 createTicks
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createTicks(): TickDataBinding {
return take((selection
.selectAll('.tick') as d3Selection)
.data(values, (x) => String(scale(x)))
.order())
Function _fnDrawColumns
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_fnDrawColumns(grid, config) {
var colsGuide = config.guide.columns || {};
var xBase = this.xBase;
var columnsScalesMap = this.columnsScalesMap;
var d3Axis = d3.axisLeft();
Function buildModel
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildModel(screenModel) {
const baseModel = BasePath.baseModel(screenModel);
const guide = this.node().config.guide;
const countCss = getLineClassesByCount(screenModel.model.scaleColor.domain().length);