swimlane/ngx-charts

View on GitHub

Showing 208 of 208 total issues

File box.component.ts has 286 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Component,
  Input,
  Output,
  EventEmitter,
Severity: Minor
Found in projects/swimlane/ngx-charts/src/lib/box-chart/box.component.ts - About 2 hrs to fix

    File circle-series.component.ts has 283 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      Component,
      Input,
      Output,
      EventEmitter,

      Function update has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        update(): void {
          super.update();
      
          this.dims = calculateViewDimensions({
            width: this.width,
      Severity: Major
      Found in projects/swimlane/ngx-charts/src/lib/sankey/sankey.component.ts - About 2 hrs to fix

        Function getYValues has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          getYValues(): any[] {
            const domain = [];
        
            for (const results of this.results) {
              for (const d of results.series) {

        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 bar-vertical.component.ts has 276 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          Component,
          Input,
          ViewEncapsulation,
          Output,

          Function updateData has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

            updateData() {
              if (!this.realTimeData) {
                return;
              }
          
          
          Severity: Minor
          Found in src/app/app.component.ts - About 2 hrs to fix

          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 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            update(): void {
              super.update();
          
              this.dims = calculateViewDimensions({
                width: this.width,

            File bar-horizontal.component.ts has 265 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              Component,
              Input,
              Output,
              EventEmitter,

              File color-sets.ts has 263 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { ScaleType } from '../common/types/scale-type.enum';
              
              export interface Color {
                name: string;
                selectable: boolean;
              Severity: Minor
              Found in projects/swimlane/ngx-charts/src/lib/utils/color-sets.ts - About 2 hrs to fix

                Function getLinearGradientStops has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getLinearGradientStops(value: number | string, start?: number | string): Gradient[] {
                    if (start === undefined) {
                      start = this.domain[0];
                    }
                    const valueScale = scaleLinear()
                Severity: Major
                Found in projects/swimlane/ngx-charts/src/lib/common/color.helper.ts - About 2 hrs to fix

                  File series-horizontal.component.ts has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    Component,
                    Input,
                    Output,
                    EventEmitter,

                    PolarChartComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @Component({
                      selector: 'ngx-charts-polar-chart',
                      template: `
                        <ngx-charts-chart
                          [view]="[width, height]"

                      File timeline-filter-bar-chart.component.ts has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
                      import { scaleBand, scaleLinear, scaleTime } from 'd3-scale';
                      import { brushX } from 'd3-brush';
                      import { select } from 'd3-selection';
                      import {

                        Function getXDomain has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getXDomain(): any[] {
                            let values = getUniqueXDomainValues(this.results);
                        
                            this.scaleType = getScaleType(values);
                            let domain = [];

                        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 getXDomain has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getXDomain(): any[] {
                            let values = getUniqueXDomainValues(this.results);
                        
                            this.scaleType = getScaleType(values);
                            let domain = [];

                        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 getXDomain has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getXDomain(): any[] {
                            let values = getUniqueXDomainValues(this.results);
                        
                            this.scaleType = getScaleType(values);
                            let domain = [];

                        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 a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getValues(xVal): Tooltip[] {
                            const results = [];
                        
                            for (const group of this.results) {
                              const item = group.series.find(d => d.name.toString() === xVal.toString());
                        Severity: Minor
                        Found in projects/swimlane/ngx-charts/src/lib/common/tooltip-area.component.ts - About 2 hrs to fix

                        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 getToolTipText has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          getToolTipText(tooltipItem: Tooltip): string {
                            let result: string = '';
                            if (tooltipItem.series !== undefined) {
                              result += tooltipItem.series;
                            } else {
                        Severity: Minor
                        Found in projects/swimlane/ngx-charts/src/lib/common/tooltip-area.component.ts - About 2 hrs to fix

                        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 cloneData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                          private cloneData(data): any {
                            const results = [];
                        
                            for (const item of data) {
                              const copy = {};
                        Severity: Minor
                        Found in projects/swimlane/ngx-charts/src/lib/common/base-chart.component.ts - About 2 hrs to fix

                        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 mapDataPointToCircle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          mapDataPointToCircle(d: any, i: number): Circle {
                            const seriesName = this.data.name as string;
                        
                            const value = d.value;
                            const label = d.name;
                          Severity
                          Category
                          Status
                          Source
                          Language