mitjajez/SONCE

View on GitHub
imports/ui/components/circuits-show.js

Summary

Maintainability
F
2 wks
Test Coverage

File circuits-show.js has 766 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import './circuits-show.html';

import { Template } from 'meteor/peerlibrary:blaze-components';
import { Mongo } from 'meteor/mongo';
import { ReactiveDict } from 'meteor/reactive-dict';
Severity: Major
Found in imports/ui/components/circuits-show.js - About 1 day to fix

    Function circuitShowOnCreated has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
    Open

    Template.Circuits_show.onCreated(function circuitShowOnCreated() {
      Session.setDefault('component2add', false);
    
      this.state = new ReactiveDict();
      this.state.setDefault({
    Severity: Minor
    Found in imports/ui/components/circuits-show.js - About 1 day 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 circuitShowOnCreated has 211 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Template.Circuits_show.onCreated(function circuitShowOnCreated() {
      Session.setDefault('component2add', false);
    
      this.state = new ReactiveDict();
      this.state.setDefault({
    Severity: Major
    Found in imports/ui/components/circuits-show.js - About 1 day to fix

      `` has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

      Template.Circuits_show.events({
        // COMMON --------------------------------------------------------------------
        'click .js-view-circuit' (event, instance) {
          event.preventDefault();
          instance.state.set('acting', 'viewing');
      Severity: Minor
      Found in imports/ui/components/circuits-show.js - About 3 hrs to fix

        `` has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        Template.Circuits_show.helpers({
          mouse: () => Template.instance().state.get('mouse'),
          zoom: () => Template.instance().state.get('zoom'),
          pan: () => Template.instance().state.get('pan'),
          viewZoom() {
        Severity: Minor
        Found in imports/ui/components/circuits-show.js - About 2 hrs to fix

          Function click .wiring .js-wire has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            'click .wiring .js-wire'(event, instance) {
              const name = instance.$(event.currentTarget).attr('name');
              const T = instance.state.get('mouse');
              const p = instance.snapToGrid(T);
              // console.log( `CLICK on WIRE ${name}` );
          Severity: Major
          Found in imports/ui/components/circuits-show.js - About 2 hrs to fix

            Function click .wiring .js-active-pin has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              'click .wiring .js-active-pin' (event, instance) {
                const $pin = instance.$( '.js-active-pin' );
                const p = {
                  id: $pin.attr('id'),
                  x: $pin.attr('cx'),
            Severity: Major
            Found in imports/ui/components/circuits-show.js - About 2 hrs to fix

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

                this.newNetPathPoint = (T) => { // ['a-x', 'a-l', 'l', 'l-a', 'a-y']
                  const d = this.$('.js-active-wire').data().wire.d;
                  const p = d ? getLastPointFromPathD(d) : {x:0, y:0};
              //    let p = {x:0, y:0};
              //    if(d) {
              Severity: Minor
              Found in imports/ui/components/circuits-show.js - About 1 hr to fix

                Function click .wiring .js-active-pin has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                  'click .wiring .js-active-pin' (event, instance) {
                    const $pin = instance.$( '.js-active-pin' );
                    const p = {
                      id: $pin.attr('id'),
                      x: $pin.attr('cx'),
                Severity: Minor
                Found in imports/ui/components/circuits-show.js - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                  this.getEventPoint = (event, mode) => {
                    const T = { x:0, y:0 };
                    if (event.type.indexOf('mouse') > -1) {
                      //event.type === 'mousemove'
                      if(mode === 'svg') {
                Severity: Minor
                Found in imports/ui/components/circuits-show.js - About 1 hr to fix

                  Function keyup .wiring input[name=command-line] has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    'keyup .wiring input[name=command-line]' (event, instance) {
                      // console.log( 'keydown .wiring' );
                      const $cli = instance.$('input[name=command-line]');
                      if (event.which === 87) {
                        // console.log('--> w ... wiring mode');
                  Severity: Minor
                  Found in imports/ui/components/circuits-show.js - About 1 hr to fix

                    Function click .wiring .js-wire has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      'click .wiring .js-wire'(event, instance) {
                        const name = instance.$(event.currentTarget).attr('name');
                        const T = instance.state.get('mouse');
                        const p = instance.snapToGrid(T);
                        // console.log( `CLICK on WIRE ${name}` );
                    Severity: Minor
                    Found in imports/ui/components/circuits-show.js - 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 keyup .wiring input[name=command-line] has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      'keyup .wiring input[name=command-line]' (event, instance) {
                        // console.log( 'keydown .wiring' );
                        const $cli = instance.$('input[name=command-line]');
                        if (event.which === 87) {
                          // console.log('--> w ... wiring mode');
                    Severity: Minor
                    Found in imports/ui/components/circuits-show.js - About 25 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

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

                        switch (this.state.get('wiringMode')) {
                        case 'axis-x':
                          str = ` H${T.x} V${T.y}`;
                          break;
                        case 'axis-line':
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 5 days to fix
                    imports/ui/lib/nets.js on lines 8..47

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

                    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.zoomIn = () => {
                        const C = Snap('.js-circuit-canvas').select('.js-circuit');
                        const T = this.getCanvasCenter();
                        const z = 1.1;
                        const out = C.transform().globalMatrix.scale(z, z, T.x, T.y).split();
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 6 hrs to fix
                    imports/ui/components/circuits-show.js on lines 193..200

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

                    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.zoomIn = () => {
                        const C = Snap('.js-circuit-canvas').select('.js-circuit');
                        const T = this.getCanvasCenter();
                        const z = 0.9;
                        const out = C.transform().globalMatrix.scale(z, z, T.x, T.y).split();
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 6 hrs to fix
                    imports/ui/components/circuits-show.js on lines 184..191

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

                    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(mode === 'svg') {
                            const C = Snap('.js-circuit-canvas').select('.js-circuit');
                            const t = C.transform().globalMatrix.split();
                            T.x = (event.offsetX - t.dx) / t.scalex;
                            T.y = (event.offsetY - t.dy) / t.scaley;
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 2 other locations - About 3 hrs to fix
                    imports/ui/components/circuits-show.js on lines 125..134
                    imports/ui/components/circuits-show.js on lines 154..159

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

                    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(mode === 'svg') {
                          const C = Snap('.js-circuit-canvas').select('.js-circuit');
                          const t = C.transform().globalMatrix.split();
                          T.x = T0.x / t.scalex + t.dx;
                          T.y = T0.y / t.scaley + t.dy;
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 2 other locations - About 3 hrs to fix
                    imports/ui/components/circuits-show.js on lines 113..122
                    imports/ui/components/circuits-show.js on lines 125..134

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

                    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(mode === 'svg') {
                            const C = Snap('.js-circuit-canvas').select('.js-circuit');
                            const t = C.transform().globalMatrix.split();
                            T.x = (event.layerX - t.dx) / t.scalex;
                            T.y = (event.layerY - t.dy) / t.scaley;
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 2 other locations - About 3 hrs to fix
                    imports/ui/components/circuits-show.js on lines 113..122
                    imports/ui/components/circuits-show.js on lines 154..159

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

                    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

                              insertWire.call({
                                name: w.name,
                                d:    w.d,
                                ends: w.ends.map( function(end) { return {e: `${end.e}`, p: `${end.p}`}; }),
                                cid:  w.cid,
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 3 hrs to fix
                    imports/ui/components/circuits-show.js on lines 785..790

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

                    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

                            insertWire.call({
                              name: w.name,
                              d: w.d,
                              ends: w.ends.map( function(end) { return {e: `${end.e}`, p: `${end.p}`}; }),
                              cid: w.cid,
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 3 hrs to fix
                    imports/ui/components/circuits-show.js on lines 682..687

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

                    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

                          setSelected(select) {
                            instance.state.set('selection', select ? wire._id : false);
                            instance.state.set('active', select ? 'wire' : false);
                          },
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 1 hr to fix
                    imports/ui/components/circuits-show.js on lines 365..368

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

                    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

                          setSelected(select) {
                            instance.state.set('selection', select ? element._id : false);
                            instance.state.set('active', select ? 'element' : false);
                          },
                    Severity: Major
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 1 hr to fix
                    imports/ui/components/circuits-show.js on lines 377..380

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

                    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

                          setSelected(select) {
                            instance.state.set('selection', select ? wid : false);
                            instance.state.set('active', select ? 'wire' : false);
                          },
                    Severity: Minor
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 55 mins to fix
                    imports/ui/components/circuits-show.js on lines 392..395

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

                    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

                          setSelected(doSelect) {
                            instance.state.set('selection', doSelect ? eid : false);
                            instance.state.set('active', doSelect ? 'element' : false);
                          },
                    Severity: Minor
                    Found in imports/ui/components/circuits-show.js and 1 other location - About 55 mins to fix
                    imports/ui/components/circuits-show.js on lines 406..409

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

                    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