DeuxHuitHuit/framework.js

View on GitHub
src/app-mediator.js

Summary

Maintainability
C
1 day
Test Coverage

Function gotoPage has 156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    const gotoPage = function (obj, previousPoppedUrl, pageData = {}, changeUrl = true) {
        let nextPage;
        let route = '';

        /**
Severity: Major
Found in src/app-mediator.js - About 6 hrs to fix

    File app-mediator.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Mediator controls the current page and modules
     *
     * @fileoverview Defines the App Mediator
     *
    Severity: Minor
    Found in src/app-mediator.js - About 2 hrs to fix

      Function loadSuccess has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              const loadSuccess = function (response) {
      
                  // if a redirection was detected by the browser with the original goto replicate it
                  if (!!response.redirected) {
                      window.history.replaceState({
      Severity: Minor
      Found in src/app-mediator.js - About 2 hrs to fix

        Avoid deeply nested control flow statements.
        Open

                                if (!!changeUrl) {
                                    window.history.pushState({
                                        data: {
                                            mediator: true
                                        }
        Severity: Major
        Found in src/app-mediator.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (!App.pages.loaded(obj)) {
                                      // Raise the flag to mark we are in the process
                                      // of loading a new page
                                      mediatorIsLoadingPage = true;
          
          
          Severity: Major
          Found in src/app-mediator.js - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status