Showing 269 of 3,565 total issues
Function createDispatcher
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createDispatcher(eventName: string) {
var eventFunction = events[eventName];
if (!eventFunction) {
eventFunction = function () {
Function _setupTaskRunner
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setupTaskRunner(liveSpec: GPLSpec) {
this._resetTaskRunner();
this._taskRunner = new TaskRunner({
timeout: (liveSpec.settings.renderingTimeout || Number.MAX_SAFE_INTEGER),
syncInterval: (liveSpec.settings.asyncRendering ?
Function getClosestElement
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
getClosestElement(this: PointInstance, _cursorX, _cursorY) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._boundsInfo;
Function _getBoundsInfo
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getBoundsInfo(dots) {
if (dots.length === 0) {
return null;
}
Function draw
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
draw() {
const node = this.node();
const config = node.config;
const guide = config.guide;
const options = config.options;
- 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 constructor
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
constructor(dataFrame: DataFrame, scaleConfig: ScaleConfig) {
this._fields = {};
var data;
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
init(xConfig) {
const config = Object.assign({}, xConfig);
config.guide = (config.guide || {});
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_drawMap(frames, topoJSONData) {
var self = this;
var guide = this.config.guide;
- 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 ruleApplyRatio
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
ruleApplyRatio(spec: GPLSpec, chartInstance: Plot) {
var isCoordsRect = (unitRef) => {
return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
};
- 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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
init(xConfig) {
const config = Object.assign({}, xConfig);
config.guide = utils.defaults(
- 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 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(xConfig) {
const config = BasePath.init(xConfig);
const enableStack = config.stack;
Function create
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
create(interval) {
var varSet = this.vars;
var utcTime = this.scaleConfig.utcTime;
const period = this.periodGenerator;
Function value
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: (function () {
var toStr = Object.prototype.toString;
var isCallable = function (fn) {
return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
};
Function entire-view
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
'entire-view'(srcSize, calcSize, specRef, tryOptimizeSpec) {
var g = specRef.unit.guide;
var {xFacetCount, yFacetCount} = getFacetCount(specRef);
if (yFacetCount > 0) {
Function drawAxisLabel
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawAxisLabel() {
const guide = labelGuide;
const labelTextNode = selectOrAppend(selection, `text.label`)
.attr('class', classes('label', guide.cssClass))
Function _loopTasks
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loopTasks() {
var task: Task;
var duration: number;
var frameDuration = 0;
Function getLinePiece
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var result = (function getLinePiece(t, line) {
var q = 0;
if (t > 0) {
var distance = [0];
var totalDistance = 0;
Function getFieldFormatters
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getFieldFormatters(spec: GPLSpec, formatters: {[field: string]: Formatter}) {
const info = PluginsSDK.extractFieldsFormatInfo(spec);
Object.keys(info).forEach((k) => {
if (info[k].parentField) {
Function d3_transition_attr
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var d3_transition_attr = function (keyOrMap, value) {
var d3AttrResult = d3.transition.prototype.attr.apply(this, arguments);
if (arguments.length === 0) {
throw new Error('Unexpected `transition().attr()` arguments.');
Function mcrotate
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
var mcrotate = function (currT) {
// Monte Carlo rotation move
// select a random label
var i = Math.floor(Math.random() * lab.length);