knsv/mermaid

View on GitHub
packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts

Summary

Maintainability
F
1 wk
Test Coverage

File quadrantBuilder.ts has 543 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { scaleLinear } from 'd3';
import { log } from '../../logger.js';
import type { BaseDiagramConfig, QuadrantChartConfig } from '../../config.type.js';
import defaultConfig from '../../defaultConfig.js';
import { getThemeVariables } from '../../themes/theme-default.js';
Severity: Major
Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 1 day to fix

    Function getAxisLabels has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getAxisLabels(
        xAxisPosition: typeof this.config.xAxisPosition,
        showXAxis: boolean,
        showYAxis: boolean,
        spaceData: CalculateSpaceData
    Severity: Major
    Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 3 hrs to fix

      Function getQuadrants has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        getQuadrants(spaceData: CalculateSpaceData): QuadrantQuadrantsType[] {
          const { quadrantSpace } = spaceData;
      
          const { quadrantHalfHeight, quadrantLeft, quadrantHalfWidth, quadrantTop } = quadrantSpace;
      
      
      Severity: Major
      Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 3 hrs to fix

        Function getBorders has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          getBorders(spaceData: CalculateSpaceData): QuadrantLineType[] {
            const halfExternalBorderWidth = this.config.quadrantExternalBorderStrokeWidth / 2;
            const { quadrantSpace } = spaceData;
        
            const {
        Severity: Major
        Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 2 hrs to fix

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

            calculateSpace(
              xAxisPosition: typeof this.config.xAxisPosition,
              showXAxis: boolean,
              showYAxis: boolean,
              showTitle: boolean
          Severity: Minor
          Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 1 hr to fix

            Function getQuadrantPoints has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getQuadrantPoints(spaceData: CalculateSpaceData): QuadrantPointType[] {
                const { quadrantSpace } = spaceData;
            
                const { quadrantHeight, quadrantLeft, quadrantTop, quadrantWidth } = quadrantSpace;
            
            
            Severity: Minor
            Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  if (this.data.yAxisTopText && showYAxis) {
                    axisLabels.push({
                      text: this.data.yAxisTopText,
                      fill: this.themeConfig.quadrantYAxisTextFill,
                      x:
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 328..345

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 175.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  if (this.data.yAxisBottomText && showYAxis) {
                    axisLabels.push({
                      text: this.data.yAxisBottomText,
                      fill: this.themeConfig.quadrantYAxisTextFill,
                      x:
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 346..364

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 175.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  return {
                    quadrant1Fill: defaultThemeVariables.quadrant1Fill,
                    quadrant2Fill: defaultThemeVariables.quadrant2Fill,
                    quadrant3Fill: defaultThemeVariables.quadrant3Fill,
                    quadrant4Fill: defaultThemeVariables.quadrant4Fill,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantDb.ts on lines 74..90

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 137.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                      text: {
                        text: this.data.quadrant2Text,
                        fill: this.themeConfig.quadrant2TextFill,
                        x: 0,
                        y: 0,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 375..384
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 409..418
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 426..435

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                      text: {
                        text: this.data.quadrant3Text,
                        fill: this.themeConfig.quadrant3TextFill,
                        x: 0,
                        y: 0,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 375..384
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 392..401
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 426..435

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                      text: {
                        text: this.data.quadrant1Text,
                        fill: this.themeConfig.quadrant1TextFill,
                        x: 0,
                        y: 0,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 392..401
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 409..418
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 426..435

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 4 locations. Consider refactoring.
              Open

                      text: {
                        text: this.data.quadrant4Text,
                        fill: this.themeConfig.quadrant4TextFill,
                        x: 0,
                        y: 0,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 375..384
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 392..401
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 409..418

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    {
                      strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
                      strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
                      x1: quadrantLeft - halfExternalBorderWidth,
                      y1: quadrantTop + quadrantHeight,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 554..561

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    {
                      strokeFill: this.themeConfig.quadrantExternalBorderStrokeFill,
                      strokeWidth: this.config.quadrantExternalBorderStrokeWidth,
                      x1: quadrantLeft + quadrantWidth,
                      y1: quadrantTop + halfExternalBorderWidth,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 545..552

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    {
                      strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
                      strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
                      x1: quadrantLeft + quadrantHalfWidth,
                      y1: quadrantTop + halfExternalBorderWidth,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 518..525

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    {
                      strokeFill: this.themeConfig.quadrantInternalBorderStrokeFill,
                      strokeWidth: this.config.quadrantInternalBorderStrokeWidth,
                      x1: quadrantLeft + halfExternalBorderWidth,
                      y1: quadrantTop + quadrantHalfHeight,
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 527..534

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 70.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      y:
                        xAxisPosition === 'top'
                          ? this.config.xAxisLabelPadding + titleSpace.top
                          : this.config.xAxisLabelPadding +
                            quadrantTop +
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 296..302

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 59.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      y:
                        xAxisPosition === 'top'
                          ? this.config.xAxisLabelPadding + titleSpace.top
                          : this.config.xAxisLabelPadding +
                            quadrantTop +
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 314..320

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 59.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export interface QuadrantTextType extends Point {
                text: string;
                fill: string;
                verticalPos: TextVerticalPos;
                horizontalPos: TextHorizontalPos;
              packages/mermaid/src/diagrams/xychart/chartBuilder/interfaces.ts on lines 132..139

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 59.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                setThemeConfig(themeConfig: Partial<QuadrantBuilderThemeConfig>) {
                  log.trace('setThemeConfig called with: ', themeConfig);
                  this.themeConfig = { ...this.themeConfig, ...themeConfig };
                }
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 205..208

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                setConfig(config: Partial<QuadrantBuilderConfig>) {
                  log.trace('setConfig called with: ', config);
                  this.config = { ...this.config, ...config };
                }
              packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts on lines 210..213

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                quadrantSpace: {
                  quadrantLeft: number;
                  quadrantTop: number;
                  quadrantWidth: number;
                  quadrantHalfWidth: number;
              Severity: Minor
              Found in packages/mermaid/src/diagrams/quadrant-chart/quadrantBuilder.ts and 1 other location - About 45 mins to fix
              packages/mermaid/src/diagrams/mindmap/mindmapRenderer.ts on lines 38..45

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 50.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status