zammad/zammad

View on GitHub
app/assets/javascripts/app/lib/base/jquery.noty.js

Summary

Maintainability
F
2 wks
Test Coverage

File jquery.noty.js has 876 lines of code (exceeds 250 allowed). Consider refactoring.
Open

!function(root, factory) {
     if (typeof define === 'function' && define.amd) {
         define(['jquery'], factory);
     } else if (typeof exports === 'object') {
         module.exports = factory(require('jquery'));
Severity: Major
Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 2 days to fix

    Function show has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            show: function() {
    
                var self = this;
    
                (self.options.custom) ? self.options.custom.find(self.options.layout.container.selector).append(self.$bar) : $(self.options.layout.container.selector).append(self.$bar);
    Severity: Major
    Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 2 hrs to fix

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

              close: function() {
      
                  if(this.closed) return;
                  if(this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
      
      
      Severity: Minor
      Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

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

                closeCleanUp: function() {
        
                    var self = this;
        
                    // Modal Cleaning
        Severity: Minor
        Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

          Function style has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  style   : function() {
                      $(this).css({
                          left         : 20,
                          position     : 'fixed',
                          width        : '310px',
          Severity: Minor
          Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

            Function style has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    style   : function() {
                        $(this).css({
                            right        : 20,
                            position     : 'fixed',
                            width        : '310px',
            Severity: Minor
            Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

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

                      style   : function() {
                          $(this).css({
                              position     : 'fixed',
                              width        : '310px',
                              height       : 'auto',
              Severity: Minor
              Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

                Function _build has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _build: function() {
                
                            // Generating noty bar
                            var $bar = $('<div class="noty_bar noty_type_' + this.options.type + '"></div>').attr('id', this.options.id);
                            $bar.append(this.options.template).find('.noty_text').html(this.options.text);
                Severity: Minor
                Found in app/assets/javascripts/app/lib/base/jquery.noty.js - About 1 hr to fix

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

                  $.noty.layouts.centerRight = {
                      name     : 'centerRight',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 2 days to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 758..815

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

                  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

                  $.noty.layouts.centerLeft = {
                      name     : 'centerLeft',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 2 days to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 817..874

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

                  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

                  $.noty.layouts.topCenter = {
                      name     : 'topCenter',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 588..624

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

                  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

                  $.noty.layouts.bottomCenter = {
                      name     : 'bottomCenter',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 932..968

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  $.noty.layouts.bottomLeft = {
                      name     : 'bottomLeft',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 3 other locations - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 666..704
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 970..1008
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 1009..1047

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  $.noty.layouts.topRight = {
                      name     : 'topRight',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 3 other locations - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 627..665
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 666..704
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 970..1008

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  $.noty.layouts.bottomRight = {
                      name     : 'bottomRight',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 3 other locations - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 627..665
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 970..1008
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 1009..1047

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  $.noty.layouts.topLeft = {
                      name     : 'topLeft',
                      options  : { // overrides options
                  
                      },
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 3 other locations - About 1 day to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 627..665
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 666..704
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 1009..1047

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

                  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

                  $.noty.layouts.top = {
                      name     : 'top',
                      options  : {},
                      container: {
                          object  : '<ul id="noty_top_layout_container" />',
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 6 hrs to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 557..586

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

                  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

                  $.noty.layouts.bottom = {
                      name     : 'bottom',
                      options  : {},
                      container: {
                          object  : '<ul id="noty_bottom_layout_container" />',
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 6 hrs to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 902..931

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

                  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).css({
                                      left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
                                      top : ($(window).height() - actual_height) / 2 + 'px'
                                  });
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 739..742

                  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

                                  $(this).animate({
                                      left: ($(window).width() - $(this).outerWidth(false)) / 2 + 'px',
                                      top : ($(window).height() - actual_height) / 2 + 'px'
                                  }, 500);
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 733..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

                      $.noty.setType = function(id, type) {
                          return $.noty.get(id) ? $.noty.get(id).setType(type) : false;
                      };
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 475..477

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

                  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

                      $.noty.setText = function(id, text) {
                          return $.noty.get(id) ? $.noty.get(id).setText(text) : false;
                      };
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 479..481

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

                  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

                                  self.$bar.delay(self.options.timeout).promise().done(function() {
                                      self.close();
                                  });
                  Severity: Minor
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 55 mins to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 182..184

                  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

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

                                  self.$bar.delay(self.options.timeout).promise().done(function() {
                                      self.close();
                                  });
                  Severity: Minor
                  Found in app/assets/javascripts/app/lib/base/jquery.noty.js and 1 other location - About 55 mins to fix
                  app/assets/javascripts/app/lib/base/jquery.noty.js on lines 320..322

                  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