microting/ngx-charts

View on GitHub

Showing 204 of 204 total issues

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

import { Component, Input, Output, EventEmitter, OnChanges, ChangeDetectionStrategy, TemplateRef } from '@angular/core';
import { trigger, style, animate, transition } from '@angular/animations';
import { formatLabel, escapeLabel } from '../common/label.helper';
import { DataItem } from '../models/chart-data.model';
import { ColorHelper } from '../common';
Severity: Minor
Found in src/bar-chart/series-vertical.component.ts - About 2 hrs to fix

    Function exports has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function(options = {}) {
      return {
        context: dir(),
        resolve: {
          extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html'],
    Severity: Major
    Found in config/webpack.common.js - About 2 hrs to fix

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

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

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

          update(): void {
            let scale;
            const sign = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
            this.tickSpacing = Math.max(this.innerTickSize, 0) + this.tickPadding;
        
        
        Severity: Major
        Found in src/common/axes/y-axis-ticks.component.ts - About 2 hrs to fix

          Function exports has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(options) {
            return webpackMerge(commonConfig({ env: ENV }), {
              devtool: 'cheap-module-source-map',
              devServer: {
                port: 9999,
          Severity: Major
          Found in config/webpack.dev.js - About 2 hrs to fix

            BarVertical2DStackedComponent has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            @Component({
              selector: 'ngx-charts-bar-vertical-2d-stacked',
              template: `
                <ngx-charts-chart
                  [view]="[width, height]"
            Severity: Minor
            Found in src/bar-chart/bar-vertical-2d-stacked.component.ts - About 2 hrs to fix

              Function exports has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function(env) {
                return webpackMerge(commonConfig({ env: ENV }), {
                  devtool: 'inline-source-map',
                  plugins: [
                    new CheckerPlugin()
              Severity: Major
              Found in config/webpack.test.js - About 2 hrs to fix

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

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

                  Function update has 60 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-stacked.component.ts - About 2 hrs to fix

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

                      getLinearGradientStops(value, start?) {
                        if (start === undefined) {
                          start = this.domain[0];
                        }
                    
                    
                    Severity: Major
                    Found in src/common/color.helper.ts - About 2 hrs to fix

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

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

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

                          update(): void {
                            let scale;
                            const sign = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
                            this.tickSpacing = Math.max(this.innerTickSize, 0) + this.tickPadding;
                        
                        
                        Severity: Minor
                        Found in src/common/axes/y-axis-ticks.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 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 = [];
                        Severity: Minor
                        Found in src/line-chart/line-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 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 = [];
                        Severity: Minor
                        Found in src/area-chart/area-chart-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

                        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 = [];
                        Severity: Minor
                        Found in src/area-chart/area-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 getValues has a Cognitive Complexity of 16 (exceeds 5 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());
                        Severity: Minor
                        Found in src/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: any): string {
                            let result: string = '';
                            if (tooltipItem.series !== undefined) {
                              result += tooltipItem.series;
                            } else {
                        Severity: Minor
                        Found in src/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

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

                        import { Component, Input, Output, EventEmitter, ViewEncapsulation, ChangeDetectionStrategy } from '@angular/core';
                        import { scaleLinear, scaleTime, scaleBand } from 'd3-scale';
                        import { brushX } from 'd3-brush';
                        import { select, event as d3event } from 'd3-selection';
                        
                        
                        Severity: Minor
                        Found in demo/timeline-filter-bar-chart/timeline-filter-bar-chart.component.ts - About 2 hrs to fix

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

                            update(): void {
                              super.update();
                          
                              if (!this.showDataLabel) {
                                this.dataLabelMaxHeight = { negative: 0, positive: 0 };
                          Severity: Minor
                          Found in src/bar-chart/bar-vertical-2d-stacked.component.ts - About 1 hr to fix

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

                              update(): void {
                                this.updateGradient();
                            
                                let currentArea;
                                let startingArea;
                            Severity: Minor
                            Found in src/area-chart/area-series.component.ts - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language