Noosfero/noosfero

View on GitHub
plugins/pjax/public/javascripts/jquery.pjax.js

Summary

Maintainability
D
2 days
Test Coverage

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

// jquery.pjax.js
// copyright chris wanstrath
// https://github.com/defunkt/jquery-pjax

(function($){
Severity: Minor
Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 6 hrs to fix

    Function pjax has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function pjax(options) {
      options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options)
    
      if ($.isFunction(options.url)) {
        options.url = options.url()
    Severity: Major
    Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 4 hrs to fix

      Function success has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        options.success = function(data, status, xhr) {
          // If $.pjax.defaults.version is a function, invoke it first.
          // Otherwise it can be a static string.
          var currentVersion = (typeof $.pjax.defaults.version === 'function') ?
            $.pjax.defaults.version() :
      Severity: Minor
      Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 1 hr to fix

        Function onPjaxPopstate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function onPjaxPopstate(event) {
          var state = event.state
        
          if (state && state.container) {
            // When coming forward from a separate history session, will get an
        Severity: Minor
        Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 1 hr to fix

          Function extractContainer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function extractContainer(data, xhr, options) {
            var obj = {}
          
            // Prefer X-PJAX-URL header if it was set, otherwise fallback to
            // using the original requested url.
          Severity: Minor
          Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 1 hr to fix

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

            function fallbackPjax(options) {
              var url = $.isFunction(options.url) ? options.url() : options.url,
                  method = options.type ? options.type.toUpperCase() : 'GET'
            
              var form = $('<form>', {
            Severity: Minor
            Found in plugins/pjax/public/javascripts/jquery.pjax.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status