microting/ngx-charts

View on GitHub

Showing 204 of 204 total issues

Function getSeries has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  getSeries(): any[] {
    const total = this.designatedTotal ? this.designatedTotal : this.getTotal();

    return this.data.map(d => {
      const baselineLabelHeight = 20;
Severity: Minor
Found in src/pie-chart/pie-grid.component.ts - About 1 hr to fix

    Function getCircles has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getCircles(): any[] {
        const seriesName = this.data.name;
    
        return this.data.series.map((d, i) => {
          if (typeof d.y !== 'undefined' && typeof d.x !== 'undefined') {

      Function update has a Cognitive Complexity of 13 (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-stacked.component.ts - About 1 hr 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 getTicks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        getTicks(): any {
          const bigTickSegment = this.angleSpan / this.bigSegments;
          const smallTickSegment = bigTickSegment / (this.smallSegments);
          const tickLength = 20;
          const ticks = {
      Severity: Minor
      Found in src/gauge/gauge-axis.component.ts - About 1 hr 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 getGridPanels has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getGridPanels(): any[] {
          return this.data.map((d) => {
            let offset;
            let width;
            let height;
      Severity: Minor
      Found in src/common/grid-panel-series.component.ts - About 1 hr to fix

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

          update(): void {
            super.update();
        
            if (this.labels && this.hasNoOptionalMarginsSet()) {
              this.margins = [30, 80, 30, 80];
        Severity: Minor
        Found in src/pie-chart/pie-chart.component.ts - About 1 hr to fix

          Function gridLayout has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function gridLayout(dims, data, minWidth, designatedTotal) {
            const xScale: any = scaleBand<number>();
            const yScale: any = scaleBand<number>();
            const width = dims.width;
            const height = dims.height;
          Severity: Minor
          Found in src/common/grid-layout.helper.ts - About 1 hr to fix

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

              update(): void {
                super.update();
            
                this.formatDates();
            
            
            Severity: Minor
            Found in src/heat-map/heat-map.component.ts - About 1 hr to fix

              Function count has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function count(countFrom, countTo, countDecimals, countDuration, callback) {
                const startVal = Number(countFrom);
                const endVal = Number(countTo);
                const countDown = startVal > endVal;
                const decimals = Math.max(0, countDecimals);
              Severity: Minor
              Found in src/common/count/count.helper.ts - About 1 hr to fix

                Function getArcs has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getArcs(): any[] {
                    const arcs = [];
                
                    const availableRadius = this.outerRadius * 0.7;
                
                
                Severity: Minor
                Found in src/gauge/gauge.component.ts - About 1 hr to fix

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

                    getYDomain(): any[] {
                      const domain = [];
                  
                      for (let i = 0; i < this.xSet.length; i++) {
                        const val = this.xSet[i];
                  Severity: Minor
                  Found in src/area-chart/area-chart-stacked.component.ts - About 1 hr 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 edges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    get edges() {
                      let edges = [false, false, false, false];
                      if (this.roundEdges) {
                        if (this.orientation === 'vertical') {
                          if (this.data.value > 0) {
                  Severity: Minor
                  Found in src/bar-chart/bar.component.ts - About 1 hr 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 shouldFlip has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    static shouldFlip(elDimensions, popoverDimensions, placement, spacing): boolean {
                      let flip = false;
                  
                      if (placement === 'right') {
                        if (elDimensions.left + elDimensions.width + popoverDimensions.width + spacing > window.innerWidth) {
                  Severity: Minor
                  Found in src/common/tooltip/position/position.ts - About 1 hr 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 getColor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getColor(value) {
                      if (value === undefined || value === null) {
                        throw new Error('Value can not be null');
                      }
                      if (this.scaleType === 'linear') {
                  Severity: Minor
                  Found in src/common/color.helper.ts - About 1 hr 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 formatDates has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    formatDates(): void {
                      for (let i = 0; i < this.results.length; i++) {
                        const g = this.results[i];
                        g.label = g.name;
                        if (g.label instanceof Date) {
                  Severity: Minor
                  Found in src/common/base-chart.component.ts - About 1 hr 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 35 lines of code (exceeds 25 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 1 hr to fix

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

                    module.exports = function(env) {
                      return webpackMerge(commonConfig({ env: ENV }), {
                        devtool: "source-map",
                        module: {
                          exprContextCritical: false,
                    Severity: Minor
                    Found in config/webpack.package.js - About 1 hr to fix

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

                        update(): void {
                          const scale = this.scale;
                          this.ticks = this.getTicks();
                      
                          if (this.tickFormatting) {
                      Severity: Minor
                      Found in src/common/axes/x-axis-ticks.component.ts - About 1 hr to fix

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

                          update(): void {
                            super.update();
                        
                            if (!this.showAxis) {
                              if (!this.margin) {
                        Severity: Minor
                        Found in src/gauge/gauge.component.ts - About 1 hr to fix

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

                            update(): void {
                              super.update();
                              this.dims = calculateViewDimensions({
                                width: this.width,
                                height: this.height,
                          Severity: Minor
                          Found in demo/combo-chart/combo-chart.component.ts - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language