microting/ngx-charts

View on GitHub

Showing 204 of 204 total issues

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

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

      mapDataPointToCircle(d: any, i: number): any {
        const seriesName = this.data.name;
    
        const value = d.value;
        const label = d.name;
    Severity: Minor
    Found in src/common/circle-series.component.ts - About 1 hr to fix

      Function calculateLabelPositions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        calculateLabelPositions(pieData): any {
          const factor = 1.5;
          const minDistance = 10;
          const labelPositions = pieData;
      
      
      Severity: Minor
      Found in src/pie-chart/pie-series.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 update has a Cognitive Complexity of 15 (exceeds 5 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

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

        setTicks() {
          let tickFormat;
          if (this.xAxisTickFormatting) {
            tickFormat = this.xAxisTickFormatting;
          } else if (this.xScale.tickFormat) {
      Severity: Minor
      Found in src/polar-chart/polar-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 getYDomain has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        getYDomain(): any[] {
          if (this.valueDomain) {
            return this.valueDomain;
          }
      
      

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

        setTicks() {
          let tickFormat;
          if (this.xAxisTickFormatting) {
            tickFormat = this.xAxisTickFormatting;
          } else if (this.xScale.tickFormat) {
      Severity: Minor
      Found in src/polar-chart/polar-chart.component.ts - About 1 hr to fix

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

        module.exports =  function(config) {
          var configuration = {
            basePath: '',
            singleRun: true,
            frameworks: ['jasmine'],
        Severity: Minor
        Found in config/karma.conf.js - About 1 hr to fix

          Function count has a Cognitive Complexity of 14 (exceeds 5 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

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

            getValueDomain(): any[] {
              const domain = [];
              let smallest = 0;
              let biggest = 0;
              for (const group of this.results) {
          Severity: Minor
          Found in src/bar-chart/bar-horizontal-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 updateDataLabels has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            updateDataLabels() {
              if (this.type === 'stacked') {
                this.barsForDataLabels = [];
                const section: any = {};
                section.series = this.seriesName;
          Severity: Minor
          Found in src/bar-chart/series-vertical.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 gridLayout has a Cognitive Complexity of 14 (exceeds 5 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

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

            getValueDomain() {
              const domain = [];
              let smallest = 0;
              let biggest = 0;
              for (const group of this.results) {
          Severity: Minor
          Found in src/bar-chart/bar-vertical-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 getLinearGradientStops has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            getLinearGradientStops(value, start?) {
              if (start === undefined) {
                start = this.domain[0];
              }
          
          
          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 updateDataLabels has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            updateDataLabels() {
              if (this.type === 'stacked') {
                this.barsForDataLabels = [];
                const section: any = {};
                section.series = this.seriesName;
          Severity: Minor
          Found in src/bar-chart/series-horizontal.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 updateData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            updateData() {
              if (!this.realTimeData) {
                return;
              }
          
          
          Severity: Minor
          Found in demo/app.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 update has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            update(): void {
              if (this.data.length > 2) {
                const valueFormatting = this.valueFormatting || (card => card.value.toLocaleString());
          
                const sortedLengths = this.data
          Severity: Minor
          Found in src/number-card/card-series.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 getTooltipMinMaxText has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

            getTooltipMinMaxText(min: any, max: any) {
              if (min !== undefined || max !== undefined) {
                let result = ' (';
                if (min !== undefined) {
                  if (max === undefined) {
          Severity: Minor
          Found in src/common/circle-series.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 43 lines of code (exceeds 25 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

            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) => {
            Severity: Minor
            Found in src/bubble-chart/bubble-series.component.ts - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language