microting/ngx-charts

View on GitHub

Showing 204 of 204 total issues

File bar-vertical-stacked.component.ts has 339 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  Component,
  Input,
  Output,
  EventEmitter,
Severity: Minor
Found in src/bar-chart/bar-vertical-stacked.component.ts - About 4 hrs to fix

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

        this.bars = this.series.map((d, index) => {
          let value = d.value;
          const label = this.getLabel(d);
          const formattedLabel = formatLabel(label);
          let roundEdges = this.roundEdges;
    Severity: Major
    Found in src/bar-chart/series-vertical.component.ts - About 3 hrs to fix

      Function updateData has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

          update(): void {
            super.update();
        
            this.dims = calculateViewDimensions({
              width: this.width,
        Severity: Minor
        Found in src/area-chart/area-chart-normalized.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 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.bars = this.series.map((d, index) => {
              let value = d.value;
              const label = this.getLabel(d);
              const formattedLabel = formatLabel(label);
              const roundEdges = this.roundEdges;
        Severity: Major
        Found in src/bar-chart/series-horizontal.component.ts - About 3 hrs to fix

          Function update has 85 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 demo/combo-chart/combo-series-vertical.component.ts - About 3 hrs to fix

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

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

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

                update(): void {
                  super.update();
              
                  this.dims = calculateViewDimensions({
                    width: this.width,
              Severity: Major
              Found in src/area-chart/area-chart-normalized.component.ts - About 3 hrs to fix

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

                  getYDomain(): any[] {
                    const domain = [];
                    for (const results of this.results) {
                      for (const d of results.series) {
                        if (domain.indexOf(d.value) < 0) {
                Severity: Minor
                Found in src/line-chart/line-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 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 demo/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

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

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

                  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 demo/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 demo/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

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

                  import {
                    Component,
                    Input,
                    Output,
                    ViewEncapsulation,
                  Severity: Minor
                  Found in src/bar-chart/bar-horizontal-normalized.component.ts - About 3 hrs to fix

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

                    @Component({
                      selector: 'combo-chart-component',
                      template: `
                        <ngx-charts-chart
                          [view]="[width + legendSpacing, height]"
                    Severity: Minor
                    Found in demo/combo-chart/combo-chart.component.ts - About 3 hrs to fix

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

                      import {
                        Component,
                        Input,
                        Output,
                        EventEmitter,
                      Severity: Minor
                      Found in src/bar-chart/bar-vertical-normalized.component.ts - About 2 hrs to fix

                        Function bars has 73 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);
                        Severity: Major
                        Found in demo/combo-chart/combo-series-vertical.component.ts - About 2 hrs to fix

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

                          import {
                            Component,
                            Input,
                            ViewEncapsulation,
                            Output,
                          Severity: Minor
                          Found in src/bar-chart/bar-vertical.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) {
                            Severity: Minor
                            Found in src/polar-chart/polar-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 getValueStackedDomain has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                            Open

                              getValueStackedDomain() {
                                const domain = [];
                                let smallest = 0;
                                let biggest = 0;
                            
                            
                            Severity: Minor
                            Found in src/bar-chart/bar-vertical-2d-stacked.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

                            Severity
                            Category
                            Status
                            Source
                            Language