Showing 269 of 3,565 total issues
Function calcSizeRecursively
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var calcSizeRecursively = (
prop: 'x' | 'y',
root: Unit,
takeStepSizeStrategy: StepSizeStrategy,
frame: DataFrameObject = null
Function getTestWebpackConfig
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTestWebpackConfig(DEBUG) {
const path = require('path');
const webpack = require('webpack');
Function getLinePiece
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var result = (function getLinePiece(t, line) {
var pointsCount = (line.length - 1) / 3 + 1;
var q = 0;
if (t > 0) {
var distance = [0];
Function ruleExtractAxes
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ruleExtractAxes(spec: GPLSpec) {
var isCoordsRect = (unitRef: Unit) => {
return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
};
Function buildModel
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildModel(screenModel, {prettify, minBarH, minBarW, baseCssClass}) {
const barSize = ((d) => {
var w = screenModel.size(d);
if (prettify) {
Function getClosestElement
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
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 ChartLine
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ChartLine = (rawConfig: ChartConfig) => {
var config = normalizeConfig(rawConfig);
var data = config.data;
Function _calcLabels
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_calcLabels(topoJSONData, reverseContours, path) {
var innerW = this.W;
var innerH = this.H;
Function BUILD-LABELS
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
'BUILD-LABELS': (srcSpec, meta) => {
var spec = utils.clone(srcSpec);
var xLabels = [];
Function _enableBrushing
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_enableBrushing(cols) {
const brushWidth = 16;
var columnsSelections = this.columnsSelections;
Function updateGroupContainer
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateGroupContainer = function (selection) {
selection.call(attrs(model.groupAttributes));
const points = selection
Function drawFrames
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawFrames(frames) {
var node = Object.assign({}, this.config);
var options = node.options;
Function drawText
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function drawText(ticks: TickDataBinding) {
const textAnchor = scaleGuide.textAnchor;
const ty = (ko * spacing);
const tdy = (orient === Orient.top ? '0em' : orient === Orient.bottom ? '0.71em' : '0.32em');
Function ruleApplyRatio
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ruleApplyRatio(spec: GPLSpec, chartInstance: Plot) {
var isCoordsRect = (unitRef) => {
return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
};
Function _getBoundsInfo
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getBoundsInfo(bars) {
if (bars.length === 0) {
return null;
}
Function drawFrames
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drawFrames(frames) {
var node = this.config;
var options = this.config.options;
Function transformConfig
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function transformConfig(type: string, config: ChartConfig) {
var x = config.x;
var y = config.y;
var guide = config.guide;
Function _pickPlace
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_pickPlace(target) {
if (!this.options.auto) {
return this.options.place;
}
const winBound = 0 | this.options.winBound;
Function getFacetCount
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getFacetCount = (specRef: GPLSpec) => {
var xFacetKeys: string[] = [];
var yFacetKeys: string[] = [];
var getFacetKeys = (root: Unit) => {
// TODO: Maybe there is an API to
Function draw
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
draw() {
const node = this.node();
const config = node.config;
const options = config.options;
// TODO: hide it somewhere
- 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"