Showing 204 of 204 total issues
Function getSeries
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
getSeries(): any[] {
const total = this.designatedTotal ? this.designatedTotal : this.getTotal();
return this.data.map(d => {
const baselineLabelHeight = 20;
Function getCircles
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
getCircles(): any[] {
const seriesName = this.data.name;
return this.data.series.map((d, i) => {
if (typeof d.y !== 'undefined' && typeof d.x !== 'undefined') {
Function getTicks
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getTicks(): any {
const bigTickSegment = this.angleSpan / this.bigSegments;
const smallTickSegment = bigTickSegment / (this.smallSegments);
const tickLength = 20;
const ticks = {
- 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 update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
- 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 getGridPanels
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
getGridPanels(): any[] {
return this.data.map((d) => {
let offset;
let width;
let height;
Function gridLayout
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function gridLayout(dims, data, minWidth, designatedTotal) {
const xScale: any = scaleBand<number>();
const yScale: any = scaleBand<number>();
const width = dims.width;
const height = dims.height;
Function update
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(): void {
super.update();
if (this.labels && this.hasNoOptionalMarginsSet()) {
this.margins = [30, 80, 30, 80];
Function update
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(): void {
super.update();
this.formatDates();
Function getArcs
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
getArcs(): any[] {
const arcs = [];
const availableRadius = this.outerRadius * 0.7;
Function count
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function count(countFrom, countTo, countDecimals, countDuration, callback) {
const startVal = Number(countFrom);
const endVal = Number(countTo);
const countDown = startVal > endVal;
const decimals = Math.max(0, countDecimals);
Function formatDates
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
formatDates(): void {
for (let i = 0; i < this.results.length; i++) {
const g = this.results[i];
g.label = g.name;
if (g.label instanceof Date) {
- 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 shouldFlip
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static shouldFlip(elDimensions, popoverDimensions, placement, spacing): boolean {
let flip = false;
if (placement === 'right') {
if (elDimensions.left + elDimensions.width + popoverDimensions.width + spacing > window.innerWidth) {
- 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 edges
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
get edges() {
let edges = [false, false, false, false];
if (this.roundEdges) {
if (this.orientation === 'vertical') {
if (this.data.value > 0) {
- 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 getColor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getColor(value) {
if (value === undefined || value === null) {
throw new Error('Value can not be null');
}
if (this.scaleType === 'linear') {
- 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 getYDomain
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getYDomain(): any[] {
const domain = [];
for (let i = 0; i < this.xSet.length; i++) {
const val = this.xSet[i];
- 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 getValues
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getValues(xVal): any[] {
const results = [];
for (const group of this.results) {
const item = group.series.find(d => d.name.toString() === xVal.toString());
Function update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(): void {
super.update();
if (!this.showAxis) {
if (!this.margin) {
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(env) {
return webpackMerge(commonConfig({ env: ENV }), {
devtool: "source-map",
module: {
exprContextCritical: false,
Function update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(): void {
const scale = this.scale;
this.ticks = this.getTicks();
if (this.tickFormatting) {
Function update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
height: this.height,