swimlane/ngx-charts

View on GitHub

Showing 208 of 208 total issues

Function update has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

  update(): void {
    super.update();

    this.dims = calculateViewDimensions({
      width: this.width,

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

import {
  Component,
  Input,
  Output,
  EventEmitter,

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

    import {
      Component,
      Input,
      Output,
      ViewEncapsulation,

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

        update(): void {
          this.updateTooltipSettings();
          const d0 = {
            [D0Types.positive]: 0,
            [D0Types.negative]: 0

        File heat-map.component.ts has 311 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import {
          Component,
          Input,
          ViewEncapsulation,
          ChangeDetectionStrategy,
        Severity: Minor
        Found in projects/swimlane/ngx-charts/src/lib/heat-map/heat-map.component.ts - About 3 hrs to fix

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

          import {
            Component,
            Input,
            Output,
            EventEmitter,

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

              update(): void {
                let width;
                if (this.series.length) {
                  width = this.xScale.bandwidth();
                  this.bandwidth.emit(width);
            Severity: Major
            Found in src/app/custom-charts/combo-chart/combo-series-vertical.component.ts - About 3 hrs to fix

              Function update has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                update(): void {
                  let width;
                  if (this.series.length) {
                    width = this.xScale.bandwidth();
                    this.bandwidth.emit(width);
              Severity: Minor
              Found in src/app/custom-charts/combo-chart/combo-series-vertical.component.ts - About 3 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 getYDomain has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                getYDomain(): [number, number] {
                  const domain = [];
                  for (const results of this.results) {
                    for (const d of results.series) {
                      if (domain.indexOf(d.value) < 0) {

              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 23 (exceeds 5 allowed). Consider refactoring.
              Open

                update(): void {
                  const scale = this.scale;
                  const sign = this.orient === Orientation.Top || this.orient === Orientation.Right ? -1 : 1;
                  this.tickSpacing = Math.max(this.innerTickSize, 0) + this.tickPadding;
              
              

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

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

                File y-axis-ticks.component.ts has 300 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                  Component,
                  Input,
                  Output,
                  OnChanges,

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

                  import {
                    Component,
                    Input,
                    ElementRef,
                    ViewChild,
                  Severity: Minor
                  Found in projects/swimlane/ngx-charts/src/lib/gauge/gauge.component.ts - About 3 hrs to fix

                    Function bars has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.bars = this.series.map((d, index) => {
                          let value = d.value as any;
                          const label = this.getLabel(d);
                          const formattedLabel = formatLabel(label);
                          const roundEdges = this.roundEdges;

                      Function getYDomain has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                      Open

                        getYDomain(): any[] {
                          if (this.valueDomain) {
                            return this.valueDomain;
                          }
                      
                      
                      Severity: Minor
                      Found in src/app/custom-charts/sparkline/sparkline.component.ts - About 3 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 getYDomainLine has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                      Open

                        getYDomainLine(): any[] {
                          const domain = [];
                      
                          for (const results of this.lineChart) {
                            for (const d of results.series) {
                      Severity: Minor
                      Found in src/app/custom-charts/combo-chart/combo-chart.component.ts - About 3 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 bars has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          this.bars = this.series.map(d => {
                            let value = d.value as any;
                            const label = this.getLabel(d);
                            const formattedLabel = formatLabel(label);
                            const roundEdges = this.roundEdges;

                        ComboChartComponent has 26 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Component({
                          // tslint:disable-next-line: component-selector
                          selector: 'combo-chart-component',
                          templateUrl: './combo-chart.component.html',
                          styleUrls: ['./combo-chart.component.scss'],
                        Severity: Minor
                        Found in src/app/custom-charts/combo-chart/combo-chart.component.ts - About 3 hrs to fix

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

                            update(): void {
                              const scale = this.scale;
                              const sign = this.orient === Orientation.Top || this.orient === Orientation.Right ? -1 : 1;
                              this.tickSpacing = Math.max(this.innerTickSize, 0) + this.tickPadding;
                          
                          

                            Function bars has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                this.bars = this.series.map((d, index) => {
                                  let value = d.value;
                                  const label = d.name;
                                  const formattedLabel = formatLabel(label);
                                  const roundEdges = this.type === 'standard';
                            Severity: Major
                            Found in src/app/custom-charts/combo-chart/combo-series-vertical.component.ts - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language