extensions/objects/templates/svg-editor.component.ts

Summary

Maintainability
F
2 wks
Test Coverage

File svg-editor.component.ts has 1499 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Severity: Major
Found in extensions/objects/templates/svg-editor.component.ts - About 4 days to fix

    SvgEditorComponent has 81 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
      selector: 'svg-editor',
      templateUrl: './svg-editor.component.html',
    })
    export class SvgEditorComponent implements OnInit {
    Severity: Major
    Found in extensions/objects/templates/svg-editor.component.ts - About 1 day to fix

      Function initializeMouseEvents has 151 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        initializeMouseEvents(): void {
          // Adding event listener for polygon tool.
          this.canvas.on('mouse:dblclick', () => {
            if (this.drawMode === this.DRAW_MODE_POLY) {
              this.drawMode = this.DRAW_MODE_NONE;
      Severity: Major
      Found in extensions/objects/templates/svg-editor.component.ts - About 6 hrs to fix

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

          createChart(): void {
            let total = 0;
            let currentAngle = 0;
            let pieSlices = [];
            let legendText = '';
        Severity: Major
        Found in extensions/objects/templates/svg-editor.component.ts - About 2 hrs to fix

          Function saveSvgFile has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            saveSvgFile(): void {
              this.alertsService.clearWarnings();
          
              if (!this.isDiagramCreated()) {
                this.alertsService.addWarning('Custom Diagram not created.');
          Severity: Major
          Found in extensions/objects/templates/svg-editor.component.ts - About 2 hrs to fix

            Function continueDiagramEditing has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              continueDiagramEditing(): void {
                if (
                  this.data.savedSvgFileName &&
                  this.imageSaveDestination ===
                    AppConstants.IMAGE_SAVE_DESTINATION_LOCAL_STORAGE
            Severity: Major
            Found in extensions/objects/templates/svg-editor.component.ts - About 2 hrs to fix

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

                getPieSlice(
                  center: {x: number; y: number},
                  radius: number,
                  startAngle: number,
                  endAngle: number,
              Severity: Minor
              Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                Function loadTextObject has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  loadTextObject(element: Element, obj: fabric.Object): void {
                    const childNodes = [].slice.call(element.childNodes);
                    let value = '';
                    const coloredTextIndex = [];
                    // Extracts the text from the tspan tags and appends
                Severity: Minor
                Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                  Function setSavedSvgFilename has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    setSavedSvgFilename(filename: string, setData: boolean): void {
                      this.diagramStatus = this.STATUS_SAVED;
                      // Reset fabric js parameters.
                      this.onClear();
                      this.data = {
                  Severity: Minor
                  Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

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

                      createColorPicker(value: string): void {
                        var parent = document.getElementById(value + '-color');
                    
                        var onChangeFunc = {
                          stroke: () => this.onStrokeChange(),
                    Severity: Minor
                    Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                      Function drawQuadraticCurve has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        private drawQuadraticCurve(): void {
                          const defaultCurve = 'M 40 40 Q 95, 100, 150, 40';
                          const defaultP1TopCoordinate = 95;
                          const defaultP1LeftCoordinate = 100;
                          const defaultP0TopCoordinate = 40;
                      Severity: Minor
                      Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

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

                          createQuadraticBezier(): void {
                            if (this.drawMode === this.DRAW_MODE_NONE) {
                              this.canvas.discardActiveObject();
                              this.drawMode = this.DRAW_MODE_BEZIER;
                              this.canvas.getObjects().forEach(item => {
                        Severity: Minor
                        Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

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

                              var onSelection = () => {
                                // Ensures that the fabricjsOptions doesn't change when the user
                                // selects the quadratic bezier control points.
                                if (
                                  this.drawMode === this.DRAW_MODE_NONE ||
                          Severity: Minor
                          Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                            Function onSizeChange has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              onSizeChange(): void {
                                // Ensures that the size change is applied only to the curve and
                                // not to all the control points.
                                if (this.drawMode === this.DRAW_MODE_BEZIER) {
                                  var numberOfEdgeControlPoints = 2;
                            Severity: Minor
                            Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                              Function ngOnInit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                ngOnInit(): void {
                                  this.imageSaveDestination = this.contextService.getImageSaveDestination();
                                  this.entityId = this.contextService.getEntityId();
                                  this.entityType = this.contextService.getEntityType();
                                  const domReady = new Promise((resolve, reject) => {
                              Severity: Minor
                              Found in extensions/objects/templates/svg-editor.component.ts - About 1 hr to fix

                                Function createChart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  createChart(): void {
                                    let total = 0;
                                    let currentAngle = 0;
                                    let pieSlices = [];
                                    let legendText = '';
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts - About 35 mins 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 initializeMouseEvents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  initializeMouseEvents(): void {
                                    // Adding event listener for polygon tool.
                                    this.canvas.on('mouse:dblclick', () => {
                                      if (this.drawMode === this.DRAW_MODE_POLY) {
                                        this.drawMode = this.DRAW_MODE_NONE;
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts - About 35 mins 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

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

                                  onBoldToggle(): void {
                                    var shape = this.canvas.getActiveObject();
                                    if (shape && shape.get('type') === 'textbox') {
                                      shape.set({
                                        fontWeight: this.fabricjsOptions.bold ? 'bold' : 'normal',
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 3 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1403..1411

                                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 114.

                                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

                                  onItalicToggle(): void {
                                    var shape = this.canvas.getActiveObject();
                                    if (shape && shape.get('type') === 'textbox') {
                                      shape.set({
                                        fontStyle: this.fabricjsOptions.italic ? 'italic' : 'normal',
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 3 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1413..1421

                                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 114.

                                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 11 locations. Consider refactoring.
                                Open

                                  constructor(
                                    private alertsService: AlertsService,
                                    private assetsBackendApiService: AssetsBackendApiService,
                                    private changeDetectorRef: ChangeDetectorRef,
                                    private contextService: ContextService,
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 10 other locations - About 3 hrs to fix
                                core/templates/components/button-directives/hint-and-solution-buttons.component.ts on lines 57..68
                                core/templates/components/state-editor/state-hints-editor/state-hints-editor.component.ts on lines 63..74
                                core/templates/pages/collection-player-page/collection-player-page.component.ts on lines 100..111
                                core/templates/pages/contributor-dashboard-page/translation-opportunities/translation-opportunities.component.ts on lines 52..63
                                core/templates/pages/exploration-editor-page/editor-tab/graph-directives/state-graph-visualization.component.ts on lines 164..175
                                core/templates/pages/exploration-editor-page/statistics-tab/statistics-tab.component.ts on lines 71..82
                                core/templates/pages/exploration-player-page/learner-experience/supplemental-card.component.ts on lines 76..87
                                core/templates/pages/skill-editor-page/skill-editor-page.component.ts on lines 42..53
                                core/templates/pages/subtopic-viewer-page/subtopic-viewer-page.component.ts on lines 65..76
                                core/templates/pages/topic-viewer-page/topic-viewer-page.component.ts on lines 63..74

                                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 98.

                                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

                                  onHeightInputBlur(): void {
                                    if (this.diagramHeight > SvgEditorConstants.MAX_SVG_DIAGRAM_HEIGHT) {
                                      this.diagramHeight = SvgEditorConstants.MAX_SVG_DIAGRAM_HEIGHT;
                                    } else if (this.diagramHeight < SvgEditorConstants.MIN_SVG_DIAGRAM_HEIGHT) {
                                      this.diagramHeight = SvgEditorConstants.MIN_SVG_DIAGRAM_HEIGHT;
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 3 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 251..258

                                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 96.

                                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

                                  onWidthInputBlur(): void {
                                    if (this.diagramWidth > SvgEditorConstants.MAX_SVG_DIAGRAM_WIDTH) {
                                      this.diagramWidth = SvgEditorConstants.MAX_SVG_DIAGRAM_WIDTH;
                                    } else if (this.diagramWidth < SvgEditorConstants.MIN_SVG_DIAGRAM_WIDTH) {
                                      this.diagramWidth = SvgEditorConstants.MIN_SVG_DIAGRAM_WIDTH;
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 3 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 260..267

                                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 96.

                                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.polyOptions.lines.length !== 0 &&
                                          this.drawMode === this.DRAW_MODE_POLY &&
                                          this.isTouchDevice
                                        ) {
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 2 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1573..1584

                                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 91.

                                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.polyOptions.lines.length !== 0 &&
                                        this.drawMode === this.DRAW_MODE_POLY &&
                                        !this.isTouchDevice
                                      ) {
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 2 hrs to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1553..1564

                                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 91.

                                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 (shape && strokeShapes.indexOf(shape.get('type')) !== -1) {
                                        shape.set({
                                          stroke: this.fabricjsOptions.stroke,
                                        });
                                        this.canvas.renderAll();
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1386..1391

                                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 72.

                                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 (shape && fillShapes.indexOf(shape.get('type')) !== -1) {
                                        shape.set({
                                          fill: this.fabricjsOptions.fill,
                                        });
                                        this.canvas.renderAll();
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1367..1372

                                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 72.

                                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

                                      } else if (shape && shape.get('type') === 'textbox') {
                                        shape.set({
                                          fontSize: this.getSize(),
                                        } as Partial<fabric.Object>);
                                        this.canvas.renderAll();
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1457..1467

                                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 58.

                                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 (shape && strokeWidthShapes.indexOf(shape.get('type')) !== -1) {
                                        shape.set({
                                          strokeWidth: this.getSize(),
                                        } as Partial<fabric.Object>);
                                        this.canvas.renderAll();
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1462..1467

                                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 58.

                                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 3 locations. Consider refactoring.
                                Open

                                    const domReady = new Promise((resolve, reject) => {
                                      if (document.readyState === 'loading') {
                                        document.addEventListener('DOMContentLoaded', resolve);
                                      } else {
                                        resolve(0);
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 2 other locations - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.spec.ts on lines 689..695
                                extensions/objects/templates/svg-editor.component.ts on lines 225..231

                                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 56.

                                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 3 locations. Consider refactoring.
                                Open

                                    const domReady = new Promise((resolve, reject) => {
                                      if (document.readyState === 'loading') {
                                        document.addEventListener('DOMContentLoaded', resolve);
                                      } else {
                                        resolve(0);
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 2 other locations - About 1 hr to fix
                                extensions/objects/templates/svg-editor.component.spec.ts on lines 689..695
                                extensions/objects/templates/svg-editor.component.ts on lines 607..613

                                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 56.

                                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 3 locations. Consider refactoring.
                                Open

                                        if (e.target.name === 'p0') {
                                          curve.path[0][1] = pt.left;
                                          curve.path[0][2] = pt.top;
                                        } else if (e.target.name === 'p1') {
                                          curve.path[1][1] = pt.left;
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 2 other locations - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1598..1604
                                extensions/objects/templates/svg-editor.component.ts on lines 1601..1604

                                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

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

                                        } else if (e.target.name === 'p2') {
                                          curve.path[1][3] = pt.left;
                                          curve.path[1][4] = pt.top;
                                        }
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 2 other locations - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1595..1604
                                extensions/objects/templates/svg-editor.component.ts on lines 1598..1604

                                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

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

                                        } else if (e.target.name === 'p1') {
                                          curve.path[1][1] = pt.left;
                                          curve.path[1][2] = pt.top;
                                        } else if (e.target.name === 'p2') {
                                          curve.path[1][3] = pt.left;
                                Severity: Major
                                Found in extensions/objects/templates/svg-editor.component.ts and 2 other locations - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1595..1604
                                extensions/objects/templates/svg-editor.component.ts on lines 1601..1604

                                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

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

                                    obj.toSVG = this.createCustomToSVG(
                                      obj.toSVG,
                                      obj.type,
                                      (obj as unknown as {id: string}).id,
                                      obj
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1043..1048

                                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

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

                                    tri.toSVG = this.createCustomToSVG(
                                      tri.toSVG,
                                      tri.type,
                                      (tri as unknown as {id: string}).id,
                                      tri
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 521..526

                                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

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

                                    if (this.drawMode === this.DRAW_MODE_BEZIER) {
                                      this.getQuadraticBezierCurve().set({
                                        stroke: this.fabricjsOptions.stroke,
                                      });
                                      this.canvas.renderAll();
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1378..1392

                                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

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

                                    if (this.drawMode === this.DRAW_MODE_BEZIER) {
                                      this.getQuadraticBezierCurve().set({
                                        fill: this.fabricjsOptions.fill,
                                      });
                                      this.canvas.renderAll();
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 45 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1358..1373

                                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

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

                                  isOpenPolygonEnabled(): boolean {
                                    return (
                                      this.areAllToolsEnabled() ||
                                      (this.isDrawModePolygon() && this.polygonMode === this.OPEN_POLYGON_MODE)
                                    );
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 40 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 853..859

                                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 49.

                                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

                                      this.canvas.getObjects().forEach(item => {
                                        item.set({
                                          hoverCursor: 'default',
                                          selectable: false,
                                        });
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 40 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 962..967

                                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 49.

                                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

                                      this.canvas.getObjects().forEach(item => {
                                        item.set({
                                          hoverCursor: 'move',
                                          selectable: true,
                                        });
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 40 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 940..945

                                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 49.

                                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

                                  isClosedPolygonEnabled(): boolean {
                                    return (
                                      this.areAllToolsEnabled() ||
                                      (this.isDrawModePolygon() &&
                                        this.polygonMode === this.CLOSED_POLYGON_MODE)
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 40 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 841..846

                                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 49.

                                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

                                    this.canvas.on('mouse:dblclick', () => {
                                      if (this.drawMode === this.DRAW_MODE_POLY) {
                                        this.drawMode = this.DRAW_MODE_NONE;
                                        this.createPolyShape();
                                      }
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 40 mins to fix
                                core/templates/pages/exploration-player-page/layout-directives/progress-nav.component.ts on lines 121..126

                                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 48.

                                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

                                  pieChartDataInput = [
                                    {
                                      name: 'Data name 1',
                                      data: 10,
                                      color: '#ff0000',
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 35 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 1146..1159

                                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 46.

                                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

                                      this.pieChartDataInput = [
                                        {
                                          name: 'Data name 1',
                                          data: 10,
                                          color: '#ff0000',
                                Severity: Minor
                                Found in extensions/objects/templates/svg-editor.component.ts and 1 other location - About 35 mins to fix
                                extensions/objects/templates/svg-editor.component.ts on lines 177..190

                                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 46.

                                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