hummingbird-me/hummingbird

View on GitHub
app/assets/javascripts/old/garlic.js

Summary

Maintainability
B
6 hrs
Test Coverage

File garlic.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  Garlic.js allows you to automatically persist your forms' text field values locally,
  until the form is submitted. This way, your users don't lose any precious data if they
  accidentally close their tab or browser.

Severity: Minor
Found in app/assets/javascripts/old/garlic.js - About 2 hrs to fix

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

        , getPath: function ( elem ) {
    
          if ( 'undefined' === typeof elem ) {
            elem = this.$element;
          }
    Severity: Minor
    Found in app/assets/javascripts/old/garlic.js - About 1 hr to fix

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

        $.fn.garlic = function ( option, fn ) {
          var options = $.extend(true, {}, $.fn.garlic.defaults, option, this.data() )
            , storage = new Storage()
            , returnValue = false;
      
      
      Severity: Minor
      Found in app/assets/javascripts/old/garlic.js - About 1 hr to fix

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

            , retrieve: function () {
              if ( this.storage.has( this.path ) ) {
        
                // if data expired, destroy it!
                if ( this.options.expires ) {
        Severity: Minor
        Found in app/assets/javascripts/old/garlic.js - About 1 hr to fix

          Avoid too many return statements within this function.
          Open

                  return;
          Severity: Major
          Found in app/assets/javascripts/old/garlic.js - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status