Showing 269 of 3,565 total issues
Function ChartLine
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const ChartLine = (rawConfig: ChartConfig) => {
var config = normalizeConfig(rawConfig);
var data = config.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 ruleApplyDefaults
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ruleApplyDefaults(spec: GPLSpec) {
var settings = spec.settings || {};
var traverse = (node, iterator, parentNode) => {
- 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 highlightDataPoints
has 27 lines of code (exceeds 25 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;
Function highlight
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
highlight(filter) {
const container = this.node().config.options.container;
const x = 'tau-chart__highlighted';
Function _runTask
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_runTask(task: Task) {
var start = performance.now();
if (this._callbacks.error) {
try {
this._result = task.call(null,
Function normalizeConfig
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function normalizeConfig(config: ChartConfig) {
var x = normalizeSettings(config.x);
var y = normalizeSettings(config.y);
Function optimizeXAxisLabel
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static optimizeXAxisLabel(root: Unit, settings: ChartSettings) {
const {xAxisTickLabelLimit} = settings;
const enterSpec = (rootUnit: Unit) => {
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(xConfig) {
const config = BasePath.init(xConfig);
config.transformRules = [
Function createDiscreteScale
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
createDiscreteScale(varSet: any[], brewer: string[]) {
var defaultColorClass = () => 'color-default';
var buildArrayGetClass = (domain: any[], brewer: string[]) => {
Function labels
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((d) => {
var info = (d.properties || {});
var center = path.centroid(d);
Function normal
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
normal(srcSize, calcSize, specRef, tryOptimizeSpec) {
const {yFacetCount} = getFacetCount(specRef);
if (yFacetCount > 0) {
SpecTransformOptimize.facetsLabelsAtTop(specRef.unit, specRef.settings);
Function cross_period
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
cross_period(
dataFn: () => any[],
dimX: string,
dimY: string,
xPeriod: string,
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(spec: ChartConfig) {
this.spec = spec;
this.dist = {
sources: <DataSources>{
Function _insertLayout
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_insertLayout(target: HTMLElement | string, xSize?: Size) {
this._target = target;
this._defaultSize = Object.assign({}, xSize);
var targetNode: Element = d3.select(target as any).node();
Function isIntersect
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ax0: number,
ay0: number,
ax1: number,
ay1: number,
bx0: number,
Function intersect
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
var intersect = function (x1, x2, x3, x4, y1, y2, y3, y4) {
Function value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
value: function (predicate) {
if (this == null) {
throw new TypeError('Array.prototype.findIndex called on null or undefined');
}
if (typeof predicate !== 'function') {
- 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 drawFrames
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
drawFrames(frames) {
var node = Object.assign({}, this.config);
var options = node.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 defaults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function defaults<T>(obj: T, ...defaultObjs: T[]): T {
var length = defaultObjs.length;
if (length === 0 || !obj) {
return obj;
}
- 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 depthFirstSearch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static depthFirstSearch(node, predicate) {
if (predicate(node)) {
return node;
}
- 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"