swimlane/ngx-charts

View on GitHub

Showing 208 of 208 total issues

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

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

    this.formatDates();

Severity: Minor
Found in projects/swimlane/ngx-charts/src/lib/heat-map/heat-map.component.ts - About 1 hr to fix

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

    export function gridLayout(
      dims: ViewDimensions,
      data: GridData[],
      minWidth: number,
      designatedTotal: number
    Severity: Minor
    Found in projects/swimlane/ngx-charts/src/lib/common/grid-layout.helper.ts - About 1 hr to fix

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

        getRotationAngle(ticks: any[]): number {
          let angle = 0;
          this.maxTicksLength = 0;
          for (let i = 0; i < ticks.length; i++) {
            const tick = this.tickFormat(ticks[i]).toString();

        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 projects/swimlane/ngx-charts/src/lib/gauge/gauge.component.ts - About 1 hr to fix

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

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

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

              updateDataLabels(): void {
                if (this.type === BarChartType.Stacked) {
                  this.barsForDataLabels = [];
                  const section: any = {};
                  section.series = this.seriesName;

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

              getYDomain(): [number, number] {
                const domain = [];
            
                for (let i = 0; i < this.xSet.length; i++) {
                  const val = this.xSet[i];

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

              updateDataLabels(): void {
                if (this.type === BarChartType.Stacked) {
                  this.barsForDataLabels = [];
                  const section: any = {};
                  section.series = this.seriesName;

            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(): boolean[] {
                let edges = [false, false, false, false];
                if (this.roundEdges) {
                  if (this.orientation === BarOrientation.Vertical) {
                    if (this.data.value > 0) {
            Severity: Minor
            Found in projects/swimlane/ngx-charts/src/lib/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: DOMRect,
                popoverDimensions: DOMRect,
                placement: PlacementTypes,
                spacing: number

            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 (isDate(g.label)) {
            Severity: Minor
            Found in projects/swimlane/ngx-charts/src/lib/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 getColor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              getColor(value: StringOrNumberOrDate): string {
                if (value === undefined || value === null) {
                  throw new Error('Value can not be null');
                }
                if (this.scaleType === ScaleType.Linear) {
            Severity: Minor
            Found in projects/swimlane/ngx-charts/src/lib/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 getRotationAngle has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              getRotationAngle(ticks: any[]): number {
                let angle = 0;
                this.maxTicksLength = 0;
                for (let i = 0; i < ticks.length; i++) {
                  const tick = this.tickFormat(ticks[i]).toString();

            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): Tooltip[] {
                const results = [];
            
                for (const group of this.results) {
                  const item = group.series.find(d => d.name.toString() === xVal.toString());

              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 projects/swimlane/ngx-charts/src/lib/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 src/app/custom-charts/combo-chart/combo-chart.component.ts - About 1 hr to fix

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

                    generateColorScheme(scheme: string | Color, type: ScaleType, domain: number[] | string[]): any {
                      if (typeof scheme === 'string') {
                        scheme = colorSets.find(cs => {
                          return cs.name === scheme;
                        });
                  Severity: Minor
                  Found in projects/swimlane/ngx-charts/src/lib/common/color.helper.ts - About 1 hr to fix

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

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

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

                        update(): void {
                          super.update();
                      
                          if (this.labels && this.hasNoOptionalMarginsSet()) {
                            this.margins = [30, 80, 30, 80];

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

                        module.exports = function (config) {
                          config.set({
                            basePath: '',
                            frameworks: ['jasmine', '@angular-devkit/build-angular'],
                            plugins: [
                        Severity: Minor
                        Found in projects/swimlane/ngx-charts/karma.conf.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language