NARKOZ/ginatra

View on GitHub
public/js/lib/jquery.pjax.js

Summary

Maintainability
D
1 day
Test Coverage

File jquery.pjax.js has 372 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 public/js/lib/jquery.pjax.js - About 4 hrs to fix

    Function pjax has 106 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 public/js/lib/jquery.pjax.js - About 4 hrs to fix

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

      function onPjaxPopstate(event) {
        var state = event.state
      
        if (state && state.container) {
          var container = $(state.container)
      Severity: Minor
      Found in public/js/lib/jquery.pjax.js - About 1 hr to fix

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

          options.success = function(data, status, xhr) {
            var container = extractContainer(data, xhr, options)
        
            if (!container.contents) {
              locationReplace(container.url)
        Severity: Minor
        Found in public/js/lib/jquery.pjax.js - About 1 hr to fix

          Function extractContainer has 31 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 public/js/lib/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 public/js/lib/jquery.pjax.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status