talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/DatePicker.js

Summary

Maintainability
F
1 wk
Test Coverage

Function update has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
Open

    update : function(date, forceRefresh){
        if(this.rendered){
            var vd = this.activeDate, vis = this.isVisible();
            this.activeDate = date;
            if(!forceRefresh && vd && this.el){
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/DatePicker.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

File DatePicker.js has 518 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.3.0
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
Severity: Major
Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 1 day to fix

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

        update : function(date, forceRefresh){
            if(this.rendered){
                var vd = this.activeDate, vis = this.isVisible();
                this.activeDate = date;
                if(!forceRefresh && vd && this.el){
    Severity: Major
    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 4 hrs to fix

      Function onRender has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          onRender : function(container, position){
              var m = [
                   '<table cellspacing="0">',
                      '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">&#160;</a></td></tr>',
                      '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],
      Severity: Major
      Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 4 hrs to fix

        DatePicker has 30 functions (exceeds 20 allowed). Consider refactoring.
        Open

        Ext.DatePicker = Ext.extend(Ext.BoxComponent, {
            /**
             * @cfg {String} todayText
             * The text to display on the button that selects the current date (defaults to <code>'Today'</code>)
             */
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 3 hrs to fix

          Function onRender has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              onRender : function(container, position){
                  var m = [
                       '<table cellspacing="0">',
                          '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">&#160;</a></td></tr>',
                          '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'],
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 2 hrs 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 setCellClass has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      var setCellClass = function(cal, cell){
                          cell.title = '';
                          var t = d.clearTime(true).getTime();
                          cell.firstChild.dateValue = t;
                          if(t == today){
          Severity: Minor
          Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 1 hr to fix

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

                createMonthPicker : function(){
                    if(!this.monthPicker.dom.firstChild){
                        var buf = ['<table border="0" cellspacing="0">'];
                        for(var i = 0; i < 6; i++){
                            buf.push(
            Severity: Minor
            Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 1 hr to fix

              Function onMonthClick has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  onMonthClick : function(e, t){
                      e.stopEvent();
                      var el = new Ext.Element(t), pn;
                      if(el.is('button.x-date-mp-cancel')){
                          this.hideMonthPicker();
              Severity: Minor
              Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if(this.showToday){
                                var td = new Date().clearTime(),
                                    disable = (td < min || td > max ||
                                    (ddMatch && format && ddMatch.test(td.dateFormat(format))) ||
                                    (ddays && ddays.indexOf(td.getDay()) != -1));
                Severity: Major
                Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                             if(vis && !this.cancelFocus){
                                                 Ext.fly(c.dom.firstChild).focus(50);
                                             }
                  Severity: Major
                  Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 45 mins to fix

                    Function onMonthClick has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        onMonthClick : function(e, t){
                            e.stopEvent();
                            var el = new Ext.Element(t), pn;
                            if(el.is('button.x-date-mp-cancel')){
                                this.hideMonthPicker();
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js - About 45 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 createMonthPicker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        createMonthPicker : function(){
                            if(!this.monthPicker.dom.firstChild){
                                var buf = ['<table border="0" cellspacing="0">'];
                                for(var i = 0; i < 6; i++){
                                    buf.push(
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.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

                    Function updateMPYear has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        updateMPYear : function(y){
                            this.mpyear = y;
                            var ys = this.mpYears.elements;
                            for(var i = 1; i <= 10; i++){
                                var td = ys[i-1], y2;
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.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

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

                            if(!this.disabledDatesRE && this.disabledDates){
                                var dd = this.disabledDates,
                                    len = dd.length - 1,
                                    re = '(?:';
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/ext/src/widgets/form/DateField.js on lines 185..197

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

                    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

                                for(; i < 42; i++) {
                                     textEls[i].innerHTML = (++extraDays);
                                     d.setDate(d.getDate()+1);
                                     cells[i].className = 'x-date-nextday';
                                     setCellClass(this, cells[i]);
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 731..736

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 70.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                for(; i < startingPos; i++) {
                                    textEls[i].innerHTML = (++prevStart);
                                    d.setDate(d.getDate()+1);
                                    cells[i].className = 'x-date-prevday';
                                    setCellClass(this, cells[i]);
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 745..750

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 70.

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

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

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

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

                    Refactorings

                    Further Reading

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

                                'up' : function(e){
                                    if(e.ctrlKey){
                                        this.showNextYear();
                                    }else{
                                        this.update(this.activeDate.add('d', -7));
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 356..362

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

                    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

                                'left' : function(e){
                                    if(e.ctrlKey){
                                        this.showPrevMonth();
                                    }else{
                                        this.update(this.activeDate.add('d', -1));
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 372..378

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

                    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.prevRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-left a'), {
                                handler: this.showPrevMonth,
                                scope: this,
                                preventDefault:true,
                                stopDefault:true
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 345..350

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

                    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.nextRepeater = new Ext.util.ClickRepeater(this.el.child('td.x-date-right a'), {
                                handler: this.showNextMonth,
                                scope: this,
                                preventDefault:true,
                                stopDefault:true
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 338..343

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

                    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

                                'down' : function(e){
                                    if(e.ctrlKey){
                                        this.showPrevYear();
                                    }else{
                                        this.update(this.activeDate.add('d', 7));
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 364..370

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

                    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

                                'right' : function(e){
                                    if(e.ctrlKey){
                                        this.showNextMonth();
                                    }else{
                                        this.update(this.activeDate.add('d', 1));
                    Severity: Major
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 1 hr to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 380..386

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

                    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((pn = el.up('td.x-date-mp-month', 2))){
                                this.mpMonths.removeClass('x-date-mp-sel');
                                pn.addClass('x-date-mp-sel');
                                this.mpSelMonth = pn.dom.xmonth;
                            }
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 40 mins to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 542..552

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 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

                            else if((pn = el.up('td.x-date-mp-year', 2))){
                                this.mpYears.removeClass('x-date-mp-sel');
                                pn.addClass('x-date-mp-sel');
                                this.mpSelYear = pn.dom.xyear;
                            }
                    Severity: Minor
                    Found in app/assets/javascripts/ext/src/widgets/DatePicker.js and 1 other location - About 40 mins to fix
                    app/assets/javascripts/ext/src/widgets/DatePicker.js on lines 537..552

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 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

                    There are no issues that match your filters.

                    Category
                    Status