Noosfero/noosfero

View on GitHub
public/javascripts/application.js

Summary

Maintainability
F
6 days
Test Coverage

File application.js has 1025 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
/*
* third party libraries
*= require vendor/lodash.js
Severity: Major
Found in public/javascripts/application.js - About 2 days to fix

    Function toggleSubmenu has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    function toggleSubmenu(trigger, title, link_hash) {
      ieZIndexBugFix(trigger);
      trigger.onclick = function() {
        ieZIndexBugFix(trigger);
        var submenu = jQuery(trigger).siblings('.menu-submenu');
    Severity: Minor
    Found in public/javascripts/application.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 toggleSubmenu has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function toggleSubmenu(trigger, title, link_hash) {
      ieZIndexBugFix(trigger);
      trigger.onclick = function() {
        ieZIndexBugFix(trigger);
        var submenu = jQuery(trigger).siblings('.menu-submenu');
    Severity: Minor
    Found in public/javascripts/application.js - About 1 hr to fix

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

      function input_javascript_stuff(id) {
         jQuery(function() {
            id = 'input-' + id;
            jQuery("#add-"+ id +"-details,#edit-"+id).click(function() {
              target = '#' + id + '-form';
      Severity: Minor
      Found in public/javascripts/application.js - About 1 hr to fix

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

        function check_contact_list(contact_list) {
          jQuery(function($) {
            var verify_url = $('#verify-contact-list').attr('href');
            var add_contacts_url = $('#add-contact-list').attr('href');
            var cancel_contacts_fetching_url = $('#cancel-fetching-emails').attr('href');
        Severity: Minor
        Found in public/javascripts/application.js - About 1 hr to fix

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

          function notifyMe(title, options) {
            // Let's check if the browser supports notifications
             if (!("Notification" in window)) {
               return null;
             }
          Severity: Minor
          Found in public/javascripts/application.js - About 1 hr to fix

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

            function numbersonly(e, separator) {
              var key;
              var keychar;
              if (window.event) {
                key = window.event.keyCode;
            Severity: Minor
            Found in public/javascripts/application.js - About 1 hr to fix

              Function numbersonly has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function numbersonly(e, separator) {
                var key;
                var keychar;
                if (window.event) {
                  key = window.event.keyCode;
              Severity: Minor
              Found in public/javascripts/application.js - About 55 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 expandCategory has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function expandCategory(block, id) {
                var link = jQuery('#block_' + block + '_category_' + id);
                if (category_expanded['block'] > 0 && category_expanded['category'] > 0 && category_expanded['block'] == block && category_expanded['category'] != id && link.hasClass('category-root')) {
                  expandCategory(category_expanded['block'], category_expanded['category']);
                  category_expanded['category'] = id;
              Severity: Minor
              Found in public/javascripts/application.js - About 55 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

              Consider simplifying this complex logical expression.
              Open

                if ((key==null) || (key==0) || (key==8) ||  (key==9) || (key==13) || (key==27) ) {
                  return true;
                }
                else if ((("0123456789").indexOf(keychar) > -1)) {
                  return true;
              Severity: Major
              Found in public/javascripts/application.js - About 40 mins to fix

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

                function focus_first_field() {
                  form = document.forms[0];
                  if (form == undefined) {
                    return;
                  }
                Severity: Minor
                Found in public/javascripts/application.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

                Avoid too many return statements within this function.
                Open

                    return true;
                Severity: Major
                Found in public/javascripts/application.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return false;
                  Severity: Major
                  Found in public/javascripts/application.js - About 30 mins to fix

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

                      return str.toLowerCase()
                                .replace( /á|à|ã|â/g, "a" )
                                .replace( /é|ê/g,     "e" )
                                .replace( /í/g,       "i" )
                                .replace( /ó|ô|õ|ö/g, "o" )
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 2 hrs to fix
                    public/javascripts/application.js on lines 125..133

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

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

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

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

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

                    Refactorings

                    Further Reading

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

                      return str.toLowerCase()
                                .replace( /@.*$/,     ""  )
                                .replace( /á|à|ã|â/g, "a" )
                                .replace( /é|ê/g,     "e" )
                                .replace( /í/g,       "i" )
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 2 hrs to fix
                    public/javascripts/application.js on lines 139..147

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

                    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("top", ($(window).height() - this.height())/ 2 + $(window).scrollTop() + "px");
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 1 hr to fix
                    public/javascripts/application.js on lines 181..181

                    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

                      this.css("left", ($(window).width() - this.width()) / 2 + $(window).scrollLeft() + "px");
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 1 hr to fix
                    public/javascripts/application.js on lines 180..180

                    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

                    function small_loading(element_id, message) {
                       $('#'+element_id).addClass('small-loading');
                       if (message) {
                          $('#'+element_id).text(message);
                       }
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 1 hr to fix
                    public/javascripts/application.js on lines 239..244

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 55.

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

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

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

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

                    Refactorings

                    Further Reading

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

                    function loading(element_id, message) {
                       jQuery('#'+element_id).addClass('loading');
                       if (message) {
                          jQuery('#'+element_id).html(message);
                       }
                    Severity: Major
                    Found in public/javascripts/application.js and 1 other location - About 1 hr to fix
                    public/javascripts/application.js on lines 245..250

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 55.

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

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

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

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

                    Refactorings

                    Further Reading

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

                      else{
                        jQuery(itemId).addClass("fullwidth");
                        jQuery("#exit-fullscreen-btn").show()
                        jQuery("#fullscreen-btn").hide()
                        fullwidth = true;
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 55 mins to fix
                    public/javascripts/application.js on lines 1258..1263

                    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

                      if(fullwidth){
                        jQuery(itemId).removeClass("fullwidth");
                        jQuery("#fullscreen-btn").show()
                        jQuery("#exit-fullscreen-btn").hide()
                        fullwidth = false;
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 55 mins to fix
                    public/javascripts/application.js on lines 1264..1269

                    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

                      $(".profile-activity-item").hover(function() {
                        $(this).children(".profile-wall-actions").find("a").css("display", "block");
                      });
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 50 mins to fix
                    public/javascripts/application.js on lines 873..875

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

                    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

                      $(".profile-activity-item").mouseleave(function() {
                        $(this).children(".profile-wall-actions").find("a").css("display", "none");
                      });
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 50 mins to fix
                    public/javascripts/application.js on lines 869..871

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

                    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", (form.width() - this.width()) / 2 + form.scrollLeft() + "px");
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 40 mins to fix
                    public/javascripts/application.js on lines 170..170

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 49.

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

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

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

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

                    Refactorings

                    Further Reading

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

                      this.css("top", (form.height() - this.height())/ 2 + form.scrollTop() + "px");
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 40 mins to fix
                    public/javascripts/application.js on lines 171..171

                    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

                    log.info = function() {
                      window.log.apply(window, jQuery.merge(['info'], arguments));
                    }
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 35 mins to fix
                    public/javascripts/application.js on lines 1022..1024

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

                    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

                    log.warn = function() {
                      window.log.apply(window, jQuery.merge(['warn'], arguments));
                    }
                    Severity: Minor
                    Found in public/javascripts/application.js and 1 other location - About 35 mins to fix
                    public/javascripts/application.js on lines 1017..1019

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

                    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