sharetribe/sharetribe

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

Summary

Maintainability
F
6 days
Test Coverage

File kassi.js has 757 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Custom Javascript functions for Sharetribe
// Add custom validation methods

function add_validator_methods() {

Severity: Major
Found in app/assets/javascripts/kassi.js - About 1 day to fix

    Function add_validator_methods has 167 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function add_validator_methods() {
    
      /**
        Take string representing number with either dot (.) or comma (,)
        as decimal separator and get back number
    Severity: Major
    Found in app/assets/javascripts/kassi.js - About 6 hrs to fix

      Function initialize_update_account_info_form has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function initialize_update_account_info_form(locale, change_text, cancel_text, email_in_use_message, one_email_must_receive_notifications_message) {
        $('.account-new-email-link').click(
          function(event) {
            event.preventDefault();
            $('.account-new-email-link').hide();
      Severity: Major
      Found in app/assets/javascripts/kassi.js - About 2 hrs to fix

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

        function initialize_signup_form(locale, email_in_use_message, invalid_invitation_code_message, name_required, invitation_required) {
          $('#help_invitation_code_link').click(function(link) {
            //link.preventDefault();
            $('#help_invitation_code').lightbox_me({centered: true, zIndex: 1000000 });
          });
        Severity: Minor
        Found in app/assets/javascripts/kassi.js - About 1 hr to fix

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

          function enableSamePageScroll() {
            function filterPath(string) {
            return string
              .replace(/^\//,'')
              .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
          Severity: Minor
          Found in app/assets/javascripts/kassi.js - About 1 hr to fix

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

            function initialize_pending_consent_form(email_invalid_message, invitation_required, invalid_invitation_code_message) {
              $('#help_invitation_code_link').click(function(link) {
                $('#help_invitation_code').lightbox_me({centered: true, zIndex: 1000000 });
              });
              $('#terms_link').click(function(link) {
            Severity: Minor
            Found in app/assets/javascripts/kassi.js - About 1 hr to fix

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

              function enableSamePageScroll() {
                function filterPath(string) {
                return string
                  .replace(/^\//,'')
                  .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
              Severity: Minor
              Found in app/assets/javascripts/kassi.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 initialize_profile_view has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function initialize_profile_view(profile_id) {
                $('#load-more-listings a').on("click", function() {
                  var request_path = $(this).data().url;
                  $.get(request_path, function(data) {
                    $('#profile-listings-list').html(data);
              Severity: Minor
              Found in app/assets/javascripts/kassi.js - About 1 hr to fix

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

                function initialize_admin_social_media_form(locale, community_id, invalid_twitter_handle_message, invalid_facebook_connect_id_message, invalid_facebook_connect_secret_message) {
                  translate_validation_messages(locale);
                  var form_id = "#edit_community_" + community_id;
                  $("#community_facebook_connect_enabled").click(function(){
                    $("#community_facebook_connect_id, #community_facebook_connect_secret").prop('disabled', !this.checked);
                Severity: Minor
                Found in app/assets/javascripts/kassi.js - About 1 hr to fix

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

                  function initialize_update_profile_info_form(locale, person_id, name_required) {
                    auto_resize_text_areas("update_profile_description_text_area");
                    $('input.text_field:first').focus();
                    var form_id = "#edit_person_" + person_id;
                    $(form_id).validate({
                  Severity: Minor
                  Found in app/assets/javascripts/kassi.js - About 1 hr to fix

                    Function initialize_update_account_info_form has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function initialize_update_account_info_form(locale, change_text, cancel_text, email_in_use_message, one_email_must_receive_notifications_message) {
                    Severity: Minor
                    Found in app/assets/javascripts/kassi.js - About 35 mins to fix

                      Function initialize_signup_form has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function initialize_signup_form(locale, email_in_use_message, invalid_invitation_code_message, name_required, invitation_required) {
                      Severity: Minor
                      Found in app/assets/javascripts/kassi.js - About 35 mins to fix

                        Function initialize_admin_social_media_form has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function initialize_admin_social_media_form(locale, community_id, invalid_twitter_handle_message, invalid_facebook_connect_id_message, invalid_facebook_connect_secret_message) {
                        Severity: Minor
                        Found in app/assets/javascripts/kassi.js - About 35 mins to fix

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

                            $('#password_forgotten_link').click(function() {
                              $('#password_forgotten').slideToggle('fast');
                              $("html, body").animate({ scrollTop: $(document).height() }, 1000);
                              $('input.request_password').focus();
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 2 hrs to fix
                          app/assets/javascripts/sharetribe_common.js on lines 2..6

                          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

                              errorPlacement: function(error, element) {
                                // Custom placement for checkbox group
                                if (element.attr("name") === LISTING_SHAPE_CHECKBOX_NAME) {
                                  var container = $("#category-listing-shapes-container");
                                  error.insertAfter(container);
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/admin/custom_fields.js on lines 218..226

                          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

                            $.validator.
                              addMethod("max_bound",
                                function(value, element, otherName) {
                                  var $otherInput = ST.utils.findElementByName(otherName);
                                  return Number(toNumber(value)) > numberVal($otherInput);
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 128..134

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 62.

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

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

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

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

                          Refactorings

                          Further Reading

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

                            $.validator.
                              addMethod("min_bound",
                                function(value, element, otherName) {
                                  var $otherInput = ST.utils.findElementByName(otherName);
                                  return Number(toNumber(value)) < numberVal($otherInput);
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 120..126

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 62.

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

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

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

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

                          Refactorings

                          Further Reading

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

                              errorPlacement: function(error, element) {
                                if (element.attr("name") == "person[send_notifications][]") {
                                  error.insertAfter($("#account-settings-email-content-rows"));
                                } else {
                                  error.insertAfter(element);
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 343..349

                          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

                              errorPlacement: function(error, element) {
                                if (element.attr("name") == "testimonial[grade]") {
                                  error.appendTo($("#testimonial-grade-error"));
                                }  else {
                                  error.insertAfter(element);
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 490..496

                          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 5 locations. Consider refactoring.
                          Open

                            $('#privacy_link').click(function(link) {
                              link.preventDefault();
                              $('#privacy').lightbox_me({ centered: true, zIndex: 1000000 });
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 4 other locations - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 368..371
                          app/assets/javascripts/kassi.js on lines 372..375
                          app/assets/javascripts/kassi.js on lines 411..414
                          app/assets/javascripts/kassi.js on lines 740..743

                          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 5 locations. Consider refactoring.
                          Open

                            $('#terms_link').click(function(link) {
                              link.preventDefault();
                              $('#terms').lightbox_me({ centered: true, zIndex: 1000000 });
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 4 other locations - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 372..375
                          app/assets/javascripts/kassi.js on lines 411..414
                          app/assets/javascripts/kassi.js on lines 740..743
                          app/assets/javascripts/kassi.js on lines 744..747

                          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 5 locations. Consider refactoring.
                          Open

                            $('#terms_link').click(function(link) {
                              link.preventDefault();
                              $('#terms').lightbox_me({ centered: true, zIndex: 1000000 });
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 4 other locations - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 368..371
                          app/assets/javascripts/kassi.js on lines 372..375
                          app/assets/javascripts/kassi.js on lines 740..743
                          app/assets/javascripts/kassi.js on lines 744..747

                          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 5 locations. Consider refactoring.
                          Open

                            $('#terms_link').click(function(link) {
                              link.preventDefault();
                              $('#terms').lightbox_me({ centered: true, zIndex: 1000000 });
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 4 other locations - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 368..371
                          app/assets/javascripts/kassi.js on lines 372..375
                          app/assets/javascripts/kassi.js on lines 411..414
                          app/assets/javascripts/kassi.js on lines 744..747

                          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 5 locations. Consider refactoring.
                          Open

                            $('#privacy_link').click(function(link) {
                              link.preventDefault();
                              $('#privacy').lightbox_me({ centered: true, zIndex: 1000000 });
                            });
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 4 other locations - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 368..371
                          app/assets/javascripts/kassi.js on lines 411..414
                          app/assets/javascripts/kassi.js on lines 740..743
                          app/assets/javascripts/kassi.js on lines 744..747

                          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

                                } else if (( /radio|checkbox/i ).test( element[0].type )) {
                                  element.closest('.checkbox-container').append(errorLabel);
                                } else {
                                  errorLabel.insertAfter( element );
                                }
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 437..441

                          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

                                if (( /radio|checkbox/i ).test( element[0].type )) {
                                  element.closest('.checkbox-container').append(errorLabel);
                                } else {
                                  errorLabel.insertAfter( element );
                                }
                          Severity: Major
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 1 hr to fix
                          app/assets/javascripts/kassi.js on lines 383..387

                          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

                            $.validator.
                              addMethod("number_min", function(value, element, min) {
                                return value.length === 0 ? true : toNumber(value) >= min;
                              });
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 40 mins to fix
                          app/assets/javascripts/kassi.js on lines 186..189

                          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

                            $.validator.
                              addMethod("number_max", function(value, element, max) {
                                return value.length === 0 ? true : toNumber(value) <= max;
                              });
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 40 mins to fix
                          app/assets/javascripts/kassi.js on lines 181..184

                          Duplicated Code

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

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

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

                          Tuning

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

                            $('#description_full_link').click(function() {
                              $('#profile_description_preview').show();
                              $('#profile_description_full').hide();
                            });
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/kassi.js on lines 562..565

                          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

                            $('#description_preview_link').click(function() {
                              $('#profile_description_preview').hide();
                              $('#profile_description_full').show();
                            });
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/kassi.js on lines 566..569

                          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

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

                            $.validator.
                              addMethod("regex",
                                function(value, element, regexp) {
                                  var re = new RegExp(regexp);
                                  return re.test(value);
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/admin2/validator.js on lines 30..35

                          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

                            $('#listing-image-link').click(function() { $('#listing-image-lightbox').lightbox_me({centered: true, zIndex: 1000000}); });
                          Severity: Minor
                          Found in app/assets/javascripts/kassi.js and 1 other location - About 35 mins to fix
                          app/assets/javascripts/listing_form.js on lines 390..390

                          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