Showing 540 of 540 total issues
Function collisionResolver
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function collisionResolver() {
return (function collision_resolver() {
const DURATION = 300;
let labelHeight = 0;
// MAINN FUNCTION. RUN COLLISION RESOLVER ON A GROUP g
Function collision_resolver
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
return (function collision_resolver() {
const DURATION = 300;
let labelHeight = 0;
// MAINN FUNCTION. RUN COLLISION RESOLVER ON A GROUP g
function resolver(g) {
Hook
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
const Hook = DataConnected.extend({
//some hooks can be important. like axis x and y
//that means, if X or Y doesn't have data at some point, we can't show markers
_important: false,
Function redraw
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
redraw() {
const _this = this;
this.translator = this.model.locale.getTFunction();
Function set
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
set(attr, val, force, persistent, caller) {
const setting = this._setting;
let attrs;
let freezeCall = false; // boolean, indicates if this .set()-call froze the modelTree
- 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 component.js
has 382 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as utils from "base/utils";
import Events from "base/events";
import Model from "base/model";
import globals from "base/globals";
Function exports
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = output => {
const plugins = [
new CleanWebpackPlugin(['build']),
extractSrc,
new CopyWebpackPlugin([
Function init
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
init(model, context) {
this.name = "gapminder-timeslider";
this.template = this.template || require("./timeslider.html");
this.prevPosition = null;
- 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 _repositionLabels
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _repositionLabels(d, i, _cache, labelContext, _X, _Y, _X0, _Y0, duration, showhide, lineGroup) {
const cache = _cache || _this.cached[d[_this.KEY]];
const labelGroup = d3.select(labelContext);
Function framesQueue
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
framesQueue(framesArray, whatId) {
const _context = this;
return new function() {
this.defaultCallbacks = [];
this.callbacks = {};
Function queryQueue
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
queryQueue(readerObject, queryMergeId) {
const _context = this;
const _parsersCompare = function(readerParsers, queryParcers) {
return Object.keys(queryParcers).filter(p => queryParcers[p] !== readerParsers[p]).length == 0 &&
(Object.keys(readerParsers).length == 0 || Object.keys(queryParcers).length != 0);
Function axis
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function axis(g) {
const checkDmn = axis.scale().domain();
const checkRng = axis.scale().range();
if (!checkDmn[0] && checkDmn[0] !== 0 || !checkDmn[1] && checkDmn[1] !== 0
|| !checkRng[0] && checkRng[0] !== 0 || !checkRng[1] && checkRng[1] !== 0) {
Function _initCircles
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initCircles() {
const {
_svg,
_maxHeight,
_width,
Function redraw
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
redraw(data, useDataFiltered) {
const _this = this;
const isHook = _this._targetModel.isHook();
Function getFrames
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFrames(forceFrame, selected) {
const _this = this;
if (!this.cachedFrames) this.cachedFrames = {};
const KEYS = utils.unique(this._getAllDimensions({ exceptType: "time" }));
Function _buildIndicatorsTree
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildIndicatorsTree(tagsArray) {
if (tagsArray === true || !tagsArray) tagsArray = [];
const _this = this;
TimeModel
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
const TimeModel = DataConnected.extend({
/**
* Default values for this model
*/
Function buildScale
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
buildScale(scaleType = this.scaleType) {
let domain;
if (scaleType == "time") {
- 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 getDimensionModelsForSpace
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
getDimensionModelsForSpace(oldSpace, newSpaceDimensions) {
this.updateDimensionModels();
// match new space to entities
- 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
TreeMenu
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
const TreeMenu = Component.extend({
//setters-getters
indicatorsTree(input) {
if (!arguments.length) return this._indicatorsTree;