Floppy/carbon-diet

View on GitHub
public/iui/iui.js

Summary

Maintainability
F
3 days
Test Coverage

File iui.js has 729 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
   copyright:
   Copyright (c) 2007-12, iUI Project Members.
   See LICENSE.txt for licensing terms.
   Version 0.4-beta3
Severity: Major
Found in public/iui/iui.js - About 1 day to fix

    Function encodeForm has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function encodeForm(form)
    {
        function encode(inputs)
        {
            for (var i = 0; i < inputs.length; ++i)
    Severity: Minor
    Found in public/iui/iui.js - About 1 hr to fix

      Function encode has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function encode(inputs)
          {
              for (var i = 0; i < inputs.length; ++i)
              {
                  log("input[" + i + "]: " + inputs[i].name + " = " + inputs[i].value);
      Severity: Minor
      Found in public/iui/iui.js - About 1 hr to fix

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

            showPage: function(page, backwards)
            {
                if (page)
                {
        //            if (window.iui_ext)    window.iui_ext.injectEventMethods(page);    // TG -- why was this comment left here??
        Severity: Minor
        Found in public/iui/iui.js - About 1 hr to fix

          Function showPageByHref has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              showPageByHref: function(href, args, method, replace, cb)
              {
                // I don't think we need onerror, because readstate will still go to 4 in that case
                  function spbhCB(xhr) 
                  {
          Severity: Minor
          Found in public/iui/iui.js - About 1 hr to fix

            Function updatePage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function updatePage(page, fromPage)
            {
                if (!page.id)
                    page.id = "__" + (++newPageCount) + "__";
            
            
            Severity: Minor
            Found in public/iui/iui.js - About 1 hr to fix

              Function ajax has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ajax: function(url, args, method, cb)
                  {
                      var xhr = new XMLHttpRequest();
                      method = method ? method.toUpperCase() : "GET";
                      if (args && method == "GET")
              Severity: Minor
              Found in public/iui/iui.js - About 1 hr to fix

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

                        function spbhCB(xhr) 
                        {
                            log("xhr.readyState = " + xhr.readyState);
                            if (xhr.readyState == 4)
                            {
                Severity: Minor
                Found in public/iui/iui.js - About 1 hr to fix

                  Function slide1 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function slide1(fromPage, toPage, backwards, axis, cb)
                  {
                      if (axis == "y")
                          (backwards ? fromPage : toPage).style.top = "100%";
                      else
                  Severity: Minor
                  Found in public/iui/iui.js - About 1 hr to fix

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

                        insertPages: function(frag)
                        {
                            var nodes = frag.childNodes;
                            var targetPage;
                            for (var i = 0; i < nodes.length; ++i)
                    Severity: Minor
                    Found in public/iui/iui.js - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (form.onsubmit() == true)
                                          {
                                              form.submit();
                                          }
                      Severity: Major
                      Found in public/iui/iui.js - About 45 mins to fix

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

                            showPageByHref: function(href, args, method, replace, cb)
                        Severity: Minor
                        Found in public/iui/iui.js - About 35 mins to fix

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

                              showPageByHrefExt: function(href, args, method, replace, cb)
                          Severity: Minor
                          Found in public/iui/iui.js - About 35 mins to fix

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

                            function slide1(fromPage, toPage, backwards, axis, cb)
                            Severity: Minor
                            Found in public/iui/iui.js - About 35 mins to fix

                              There are no issues that match your filters.

                              Category
                              Status