brisket/brisket

View on GitHub

Showing 29 of 269 total issues

File ClientRenderingWorkflowSpec.js has 1104 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

describe("ClientRenderingWorkflow", function() {
    var ClientRenderingWorkflow = require("../../../lib/client/ClientRenderingWorkflow");
    var ClientRenderer = require("../../../lib/client/ClientRenderer");
Severity: Major
Found in spec/client/client/ClientRenderingWorkflowSpec.js - About 2 days to fix

    File ServerRenderingWorkflowSpec.js has 621 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    describe("ServerRenderingWorkflow", function() {
        var Backbone = require("../../lib/application/Backbone");
        var Promise = require("bluebird");
    Severity: Major
    Found in spec/server/ServerRenderingWorkflowSpec.js - About 1 day to fix

      File RenderableViewSpec.js has 562 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      describe("RenderableView", function() {
          var RenderableView = require("../../../lib/viewing/RenderableView");
          var Backbone = require("../../../lib/application/Backbone");
      Severity: Major
      Found in spec/client/viewing/RenderableViewSpec.js - About 1 day to fix

        Function execute has 157 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            execute: function(router, originalHandler, params, windough) {
                windough = windough || window;
                currentRequestId = currentRequestId + 1;
        
                var clientRequest = ClientRequest.from(windough, currentRequestId, environmentConfig);
        Severity: Major
        Found in lib/client/ClientRenderingWorkflow.js - About 6 hrs to fix

          Function execute has 113 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              execute: function(router, originalHandler, params, expressRequest, environmentConfig) {
                  var serverRequest = ServerRequest.from(expressRequest, environmentConfig);
                  var serverResponse = ServerResponse.create();
          
                  var LayoutForRoute = router.layout;
          Severity: Major
          Found in lib/server/ServerRenderingWorkflow.js - About 4 hrs to fix

            File ServerRendererSpec.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            "use strict";
            
            describe("ServerRenderer", function() {
                var Backbone = require("../../lib/application/Backbone");
                var ServerRenderer = require("../../lib/server/ServerRenderer");
            Severity: Minor
            Found in spec/server/ServerRendererSpec.js - About 4 hrs to fix

              File SetupLinksAndPushStateSpec.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              "use strict";
              
              describe("SetupLinksAndPushState", function() {
                  var SetupLinksAndPushState = require("../../../lib/client/SetupLinksAndPushState");
                  var Browser = require("../../../lib/client/Browser");
              Severity: Minor
              Found in spec/client/client/SetupLinksAndPushStateSpec.js - About 4 hrs to fix

                Function initialize has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    initialize() {
                        var Layout = Brisket.Layout.extend({
                            template: "<!DOCTYPE html>\n<html><head><title>New App</title></head><body></body></html>",
                            content: "body"
                        });
                Severity: Major
                Found in spec/mock/MockBrisketApp.js - About 4 hrs to fix

                  Function execute has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      execute: function(router, originalHandler, params, windough) {
                          windough = windough || window;
                          currentRequestId = currentRequestId + 1;
                  
                          var clientRequest = ClientRequest.from(windough, currentRequestId, environmentConfig);
                  Severity: Minor
                  Found in lib/client/ClientRenderingWorkflow.js - About 3 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  File ServerAjaxSpec.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  "use strict";
                  
                  describe("ServerAjax", function() {
                      var ServerAjax = require("../../lib/server/ServerAjax");
                      var AjaxCallsForCurrentRequest = require("../../lib/server/AjaxCallsForCurrentRequest");
                  Severity: Minor
                  Found in spec/server/ServerAjaxSpec.js - About 2 hrs to fix

                    File ClientRendererSpec.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    "use strict";
                    
                    describe("ClientRenderer", function() {
                        var ClientRenderer = require("../../../lib/client/ClientRenderer");
                        var HasPageLevelData = require("../../../lib/traits/HasPageLevelData");
                    Severity: Minor
                    Found in spec/client/client/ClientRendererSpec.js - About 2 hrs to fix

                      File ServerSpec.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      "use strict";
                      
                      describe("Server", function() {
                          var Server = require("../../lib/server/Server");
                          var ServerResponseWorkflow = require("../../lib/server/ServerResponseWorkflow");
                      Severity: Minor
                      Found in spec/server/ServerSpec.js - About 2 hrs to fix

                        Function create has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            create: function(requestedConfig) {
                                var brisketEngine = express();
                        
                                var config = requestedConfig || {};
                                var apis = config.apis || {};
                        Severity: Major
                        Found in lib/server/Server.js - About 2 hrs to fix

                          Function setup has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              setup: function(apis) {
                                  var availableApis = specificityOrderedApis(apis);
                          
                                  Backbone.ajax = function(options) {
                                      var originalUrl = options.url;
                          Severity: Major
                          Found in lib/server/ServerAjax.js - About 2 hrs to fix

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

                                    Backbone.ajax = function(options) {
                                        var originalUrl = options.url;
                                        var queryParams = options.data;
                                        var method = options.type ? options.type.toUpperCase() : "GET";
                            
                            
                            Severity: Major
                            Found in lib/server/ServerAjax.js - About 2 hrs to fix

                              Function setup has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  setup: function(bootstrappedData, appRoot) {
                                      ClientTestable.BackboneNativeAjax.Promise = Promise;
                              
                                      BootstrappedDataService.load(bootstrappedData);
                              
                              
                              Severity: Minor
                              Found in lib/client/ClientAjax.js - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function from has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  from: function(windough, requestId, environmentConfig) {
                                      environmentConfig = environmentConfig || {};
                              
                                      var protocol = windough.location.protocol;
                                      var querystring = windough.location.search.substr(1);
                              Severity: Minor
                              Found in lib/client/ClientRequest.js - About 1 hr to fix

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

                                    setup: function(bootstrappedData, appRoot) {
                                        ClientTestable.BackboneNativeAjax.Promise = Promise;
                                
                                        BootstrappedDataService.load(bootstrappedData);
                                
                                
                                Severity: Minor
                                Found in lib/client/ClientAjax.js - About 1 hr to fix

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

                                          Backbone.ajax = function(ajaxConfig) {
                                              var dataInBootstrappedData = BootstrappedDataService.getFor(ajaxConfig);
                                              var bubbledError;
                                  
                                              function bubbleErrorFrom(prop) {
                                  Severity: Minor
                                  Found in lib/client/ClientAjax.js - About 1 hr to fix

                                    Function setup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        setup: function(apis) {
                                            var availableApis = specificityOrderedApis(apis);
                                    
                                            Backbone.ajax = function(options) {
                                                var originalUrl = options.url;
                                    Severity: Minor
                                    Found in lib/server/ServerAjax.js - About 1 hr to fix

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language