Showing 204 of 204 total issues
Function update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
Function scaleText
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scaleText(element, repeat: boolean = true): void {
let el;
let resizeScale;
if (element === 'value') {
el = this.valueTextEl;
Function update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
Function update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
Function update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
if (!this.showDataLabel) {
this.dataLabelMaxHeight = { negative: 0, positive: 0 };
Function roundedRect
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function roundedRect(x, y, w, h, r, [tl, tr, bl, br]: boolean[]) {
let retval = '';
w = Math.floor(w);
h = Math.floor(h);
Function update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
Function generateData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function generateData(seriesLength: number, includeMinMaxRange: boolean, dataPoints: number = 5): MultiSeries {
const results: MultiSeries = [];
const domain: Date[] = []; // array of time stamps in milliseconds
Function update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
Function projectComponentBindings
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
projectComponentBindings(component: ComponentRef<any>, bindings: any): ComponentRef<any> {
if (bindings) {
if (bindings.inputs !== undefined) {
const bindingKeys = Object.getOwnPropertyNames(bindings.inputs);
for (const bindingName of bindingKeys) {
- 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 calculateViewDimensions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
export function calculateViewDimensions({
width, height, margins, showXAxis = false, showYAxis = false, xAxisHeight = 0,
yAxisWidth = 0, showXLabel = false, showYLabel = false, showLegend = false,
legendType = ScaleType.ordinal, legendPosition = LegendPosition.right, columns = 12
}): ViewDimensions {
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
if (!this.showDataLabel) {
this.dataLabelMaxHeight = { negative: 0, positive: 0 };
Function getCalendarData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getCalendarData(): any[] {
// today
const now = new Date();
const todaysDay = now.getDate();
const thisDay = new Date(now.getFullYear(), now.getMonth(), todaysDay);
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
this.updateGradients();
const line = this.getLineGenerator();
Function update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
this.dims = calculateViewDimensions({
width: this.width,
height: this.height,
Function getXDomain
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getXDomain(): any[] {
let values = getUniqueXDomainValues(this.results);
this.scaleType = getScaleType(values);
let domain = [];
Function getXDomain
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getXDomain(): any[] {
let values = getUniqueXDomainValues(this.results);
this.scaleType = getScaleType(values);
let domain = [];
Function throttle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function throttle(func: any, wait: number, options?: any) {
options = options || {};
let context;
let args;
let result;
Function getXDomain
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getXDomain(): any[] {
let values = getUniqueXDomainValues(this.results);
this.scaleType = getScaleType(values);
let domain = [];
Function update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update(): void {
super.update();
if (!this.showDataLabel) {
this.dataLabelMaxWidth = { negative: 0, positive: 0 };