JumpstartLab/tracks

View on GitHub
app/assets/javascripts/tracks.js

Summary

Maintainability
F
1 wk
Test Coverage

File tracks.js has 1081 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var TracksForm = {
    toggle: function(toggleLinkId, formContainerId, formId, hideLinkText,
        hideLinkTitle, showLinkText, showLinkTitle) {
        var form=$('#'+formContainerId)
        form.toggle();
Severity: Major
Found in app/assets/javascripts/tracks.js - About 2 days to fix

    Function setup_behavior has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setup_behavior: function() {
          /* add new recurring todo plus-button in sidebar */
          $(document).on("click","#add-new-recurring-todo", function(){
            $( "#new-recurring-todo" ).dialog( "open" );
          });
    Severity: Major
    Found in app/assets/javascripts/tracks.js - About 2 hrs to fix

      Function setup_behavior has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          setup_behavior: function() {
              /* in-place edit of project name */
              $('div#project_name').editable(ProjectListPage.save_project_name, {
                  style: 'padding: 0px; width=100%;',
                  submit: i18n['common.ok'],
      Severity: Major
      Found in app/assets/javascripts/tracks.js - About 2 hrs to fix

        Function setup_behavior has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setup_behavior: function() {
                /* show the notes of a todo */
                $(document).on("click",".show_notes", function () {
                    $(this).next().toggle("fast");
                    return false;
        Severity: Major
        Found in app/assets/javascripts/tracks.js - About 2 hrs to fix

          Function setup_behavior has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              setup_behavior: function() {
                  /* toggle new todo form for single todo */
                  $('#toggle_action_new').click(function(){
                      if ($("#todo_multi_add").is(':visible')) { /* hide multi next action form first */
                          $('#todo_new_action').show();
          Severity: Minor
          Found in app/assets/javascripts/tracks.js - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              setup_autocomplete_for_predecessor: function() {
                  $('input[name=predecessor_input]:not(.ac_input)')
                  .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                      if ( event.keyCode === $.ui.keyCode.TAB &&
                          $( this ).data( "autocomplete" ).menu.active ) {
          Severity: Minor
          Found in app/assets/javascripts/tracks.js - About 1 hr to fix

            Function setup_behavior has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                setup_behavior: function() {
                    /* toggle new todo form for single todo */
                    $('#toggle_action_new').click(function(){
                        if ($("#todo_multi_add").is(':visible')) { /* hide multi next action form first */
                            $('#todo_new_action').show();
            Severity: Minor
            Found in app/assets/javascripts/tracks.js - About 1 hr to fix

              Function setup_autocomplete_for_tag_list has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  setup_autocomplete_for_tag_list: function(id) {
                      $(id+':not(.ac_input)')
                      .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                          if ( event.keyCode === $.ui.keyCode.TAB &&
                              $( this ).data( "autocomplete" ).menu.active ) {
              Severity: Minor
              Found in app/assets/javascripts/tracks.js - About 1 hr to fix

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

                    setup_behavior: function () {
                        /* main menu */
                        $('ul.sf-menu').superfish({
                            delay: 250,
                            animation:   {
                Severity: Minor
                Found in app/assets/javascripts/tracks.js - About 1 hr to fix

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

                      setup_behavior: function() {
                          /* in place edit of context name */
                          $('div.context span#context_name').editable(ContextListPage.save_context_name, {
                              style: 'padding:0px',
                              submit: i18n['common.ok'],
                  Severity: Minor
                  Found in app/assets/javascripts/tracks.js - About 1 hr to fix

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

                        setup_behavior: function() {
                            /* Add note */
                            $(document).on("click",".add_note_link a", function(){
                                $('#new-note').show();
                                $('textarea#note_body').val('');
                    Severity: Minor
                    Found in app/assets/javascripts/tracks.js - About 1 hr to fix

                      Function project_defaults has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function project_defaults(){
                          if($('body').hasClass('contexts')){
                          // don't change the context
                          // see ticket #934
                          } else {
                      Severity: Minor
                      Found in app/assets/javascripts/tracks.js - About 1 hr to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                      function default_ajax_options_for_submit(ajax_type, element_to_block) {
                          // the complete is not a function but an array so you can push other
                          // functions that will be executed after the ajax call completes
                          var options = {
                              type: ajax_type,
                      Severity: Minor
                      Found in app/assets/javascripts/tracks.js - About 1 hr to fix

                        Function toggle has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            toggle: function(toggleLinkId, formContainerId, formId, hideLinkText,
                                hideLinkTitle, showLinkText, showLinkTitle) {
                        Severity: Major
                        Found in app/assets/javascripts/tracks.js - About 50 mins to fix

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

                              enable_dependency_delete: function() {
                                  $(document).on("click", 'a[class=icon_delete_dep]', function() {
                                      var form = $(this).parents('form').get(0);
                                      var predecessor_list = $(form).find('input[name=predecessor_list]');
                                      var id_list = split( predecessor_list.val() );
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.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 clearForm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          $.fn.clearForm = function() {
                              return this.each(function() {
                                  var type = this.type, tag = this.tagName.toLowerCase();
                                  if (tag == 'form')
                                      return $(':input',this).clearForm();
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js - About 35 mins to fix

                          Cognitive Complexity

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

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

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

                          Further reading

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

                              askIfNewContextProvided: function(source, element_to_block) {
                                  var givenContextName = $('#'+source+'todo_context_name').val();
                                  if (givenContextName.length == 0) return true; // do nothing and depend on rails validation error
                          
                                  var contexts = TodoItems.getContextsForAutocomplete(givenContextName, element_to_block);
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js - About 35 mins to fix

                          Cognitive Complexity

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

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

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

                          Further reading

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

                              setup_autocomplete_for_predecessor: function() {
                                  $('input[name=predecessor_input]:not(.ac_input)')
                                  .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                                      if ( event.keyCode === $.ui.keyCode.TAB &&
                                          $( this ).data( "autocomplete" ).menu.active ) {
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.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 setup_autocomplete_for_tag_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              setup_autocomplete_for_tag_list: function(id) {
                                  $(id+':not(.ac_input)')
                                  .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                                      if ( event.keyCode === $.ui.keyCode.TAB &&
                                          $( this ).data( "autocomplete" ).menu.active ) {
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.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(defaultContexts[$(this).val()] !== undefined) {
                                      var context_name = $(this).parents('form').find('input[name=context_name]');
                                      if(context_name.attr('edited') === undefined){
                                          context_name.val(defaultContexts[$(this).val()]);
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 3 hrs to fix
                          app/assets/javascripts/tracks.js on lines 1254..1259

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 98.

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

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

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

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

                          Refactorings

                          Further Reading

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

                              if(defaultTags[$(this).val()] !== undefined) {
                                  var tag_list = $(this).parents('form').find('input[name=tag_list]');
                                  if(tag_list.attr('edited') === undefined){
                                      tag_list.val(defaultTags[$(this).val()]);
                                  }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 3 hrs to fix
                          app/assets/javascripts/tracks.js on lines 1247..1252

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 98.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $(document).on("click",'.alphabetize_link', function(evt) {
                                      var confirm_message = $(this).attr("x_confirm_message")
                                      if(confirm(confirm_message)){
                                          post_with_ajax_and_block_element(this.href, $(this).parents('.alpha_sort'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 3 other locations - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 543..549
                          app/assets/javascripts/tracks.js on lines 725..731
                          app/assets/javascripts/tracks.js on lines 823..829

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

                          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

                                  $(document).on("click",".item-container a.icon_delete_item", function(evt){
                                      var confirm_message = $(this).attr("x_confirm_message")
                                      if(confirm(confirm_message)){
                                          delete_with_ajax_and_block_element(this.href, $(this).parents('.item-container'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 3 other locations - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 707..713
                          app/assets/javascripts/tracks.js on lines 725..731
                          app/assets/javascripts/tracks.js on lines 823..829

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

                          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

                                  $(document).on("click",'a.delete_context_button', function(evt){
                                      var confirm_message = $(this).attr("x_confirm_message")
                                      if(confirm(confirm_message)){
                                          delete_with_ajax_and_block_element(this.href, $(this).parents('.context'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 3 other locations - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 543..549
                          app/assets/javascripts/tracks.js on lines 707..713
                          app/assets/javascripts/tracks.js on lines 725..731

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

                          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

                                  $(document).on("click",'a.delete_project_button', function(evt){
                                      var confirm_message = $(this).attr("x_confirm_message")
                                      if(confirm(confirm_message)){
                                          delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 3 other locations - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 543..549
                          app/assets/javascripts/tracks.js on lines 707..713
                          app/assets/javascripts/tracks.js on lines 823..829

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

                          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

                                  $(document).on("click",'a.delete_user_button', function(evt){
                                      var confirm_message = $(this).attr("x_confirm_message")
                                      if(confirm(confirm_message)){
                                          delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 1047..1053

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

                          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

                                $(document).on("click",'.item-container a.delete_icon', function(evt){
                                    var confirm_message = $(this).attr("x_confirm_message")
                                    if(confirm(confirm_message)){
                                        delete_with_ajax_and_block_element(this.href, $(this).parents('.project'));
                                      }
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 2 hrs to fix
                          app/assets/javascripts/tracks.js on lines 612..618

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

                          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

                                  $(id+':not(.ac_input)')
                                  .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                                      if ( event.keyCode === $.ui.keyCode.TAB &&
                                          $( this ).data( "autocomplete" ).menu.active ) {
                                          event.preventDefault();
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 407..413

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 72.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $('input[name=predecessor_input]:not(.ac_input)')
                                  .bind( "keydown", function( event ) { // don't navigate away from the field on tab when selecting an item
                                      if ( event.keyCode === $.ui.keyCode.TAB &&
                                          $( this ).data( "autocomplete" ).menu.active ) {
                                          event.preventDefault();
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 196..202

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 72.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                $(document).on("click","#recurring_period input", function(){
                                    RecurringTodosPage.hide_all_recurring();
                                    $('#recurring_'+this.id.split('_')[4]).show();
                                });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 1035..1038

                          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

                                $(document).on("click","#recurring_edit_period input", function(){
                                    RecurringTodosPage.hide_all_edit_recurring();
                                    $('#recurring_edit_'+this.id.split('_')[5]).show();
                                });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 1002..1005

                          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

                              set_state_container_visibility: function (state, set_visible) {
                                  if (set_visible) {
                                      $('#list-'+state+'-projects-container').slideDown("fast");
                                  } else {
                                      $('#list-'+state+'-projects-container').slideUp("fast");
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 796..802

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

                          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

                              set_state_container_visibility: function (state, set_visible) {
                                  if (set_visible) {
                                      $('#list-'+state+'-contexts-container').slideDown("fast");
                                  } else {
                                      $('#list-'+state+'-contexts-container').slideUp("fast");
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 678..684

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

                          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

                                $('input[name="date_picker1"]').change(function() {
                                  var value = $('input[name="date_picker1"]:checked').val();
                                  $('input[name="prefs[date_format]"]').val(value);
                                  PreferencesPage.get_date_format('date_format');
                                });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 653..657

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

                          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

                                $('input[name="date_picker2"]').change(function() {
                                  var value = $('input[name="date_picker2"]:checked').val();
                                  $('input[name="prefs[title_date_format]"]').val(value);
                                  PreferencesPage.get_date_format('title_date_format');
                                });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 647..651

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

                          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

                          var ContextItems = {
                              setup_autocomplete_for_contexts: function(id) {
                                  $(id).autocomplete({
                                      source: relative_to_root('contexts.autocomplete'),
                                      autoFocus: true,
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 598..607

                          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

                          var ProjectItems = {
                              setup_autocomplete_for_projects: function(id) {
                                  $(id).autocomplete({
                                      source: relative_to_root('projects.autocomplete'),
                                      autoFocus: true,
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 587..596

                          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

                                  $('#toggle_context_new').click(function(evt){
                                      TracksForm.toggle('toggle_context_new', 'context_new', 'context-form',
                                          i18n['contexts.hide_form'], i18n['contexts.hide_form_title'],
                                          i18n['contexts.show_form'], i18n['contexts.show_form_title']);
                                  });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 764..768

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 58.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  close: function() {
                                    $('#recurring-todo-form-new-action input:text:first').focus();
                                    RecurringTodosPage.hide_all_recurring();
                                    RecurringTodosPage.reset_radio();
                                    $('#recurring_daily').show();
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 1026..1031

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 58.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $('#toggle_project_new').click(function(evt){
                                      TracksForm.toggle('toggle_project_new', 'project_new', 'project-form',
                                          i18n['projects.hide_form'], i18n['projects.hide_form_title'],
                                          i18n['projects.show_form'], i18n['projects.show_form_title']);
                                  });
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 850..854

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 58.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  close: function() {
                                    $('#recurring-todo-form-edit-action input:text:first').focus();
                                    RecurringTodosPage.hide_all_recurring();
                                    RecurringTodosPage.reset_radio();
                                    $('#recurring_daily').show();
                          Severity: Major
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/tracks.js on lines 993..998

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 58.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $(document).on("click", ".item-container input.item-checkbox", function(ev){
                                      put_with_ajax_and_block_element(this.value, $(this).parents(".item-container"));
                                      return false;
                                  });
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 55 mins to fix
                          app/assets/javascripts/tracks.js on lines 1041..1044

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

                          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

                                $(document).on("click",".item-container a.edit_icon", function(evt){
                                    get_with_ajax_and_block_element(this.href, $(this).parents(".item-container"));
                                    return false;
                                });
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 55 mins to fix
                          app/assets/javascripts/tracks.js on lines 526..529

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

                          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

                              hide_all_recurring: function () {
                                  $.each(['daily', 'weekly', 'monthly', 'yearly'], function(){
                                      $('#recurring_'+this).hide();
                                  });
                              },
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 45 mins to fix
                          app/assets/javascripts/tracks.js on lines 957..961

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 50.

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

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

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

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

                          Refactorings

                          Further Reading

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

                              hide_all_edit_recurring: function () {
                                  $.each(['daily', 'weekly', 'monthly', 'yearly'], function(){
                                      $('#recurring_edit_'+this).hide();
                                  });
                              },
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 45 mins to fix
                          app/assets/javascripts/tracks.js on lines 952..956

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 50.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                      onHide: function() { /* remove hightlight from todo */
                                          $(this.parent().parent().parent()).removeClass("sf-item-selected");
                                      }
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 40 mins to fix
                          app/assets/javascripts/tracks.js on lines 295..297

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 48.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                      onBeforeShow: function() { /* highlight todo */
                                          $(this.parent().parent().parent()).addClass("sf-item-selected");
                                      },
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 40 mins to fix
                          app/assets/javascripts/tracks.js on lines 298..300

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 48.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $(document).on("click",".show_successors", function () {
                                      $(this).next().toggle("fast");
                                      return false;
                                  });
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/tracks.js on lines 509..512

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 46.

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

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

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

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

                          Refactorings

                          Further Reading

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

                                  $(document).on("click",".show_notes", function () {
                                      $(this).next().toggle("fast");
                                      return false;
                                  });
                          Severity: Minor
                          Found in app/assets/javascripts/tracks.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/tracks.js on lines 514..517

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 46.

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status