imanel/websocket-rack

View on GitHub

Showing 13 of 17 total issues

File FABridge.js has 477 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
/*
Copyright 2006 Adobe Systems Incorporated

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
Severity: Minor
Found in example/html/FABridge.js - About 7 hrs to fix

    Function FABridge__bridgeInitialized has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

    function FABridge__bridgeInitialized(bridgeName) {
        var objects = document.getElementsByTagName("object");
        var ol = objects.length;
        var activeObjects = [];
        if (ol > 0) {
    Severity: Minor
    Found in example/html/FABridge.js - About 7 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

    prototype has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    {
    
    
    // bootstrapping
    
    Severity: Minor
    Found in example/html/FABridge.js - About 2 hrs to fix

      Function FABridge__bridgeInitialized has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function FABridge__bridgeInitialized(bridgeName) {
          var objects = document.getElementsByTagName("object");
          var ol = objects.length;
          var activeObjects = [];
          if (ol > 0) {
      Severity: Major
      Found in example/html/FABridge.js - About 2 hrs to fix

        File web_socket.js has 262 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
        // License: New BSD License
        // Reference: http://dev.w3.org/html5/websockets/
        // Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol
        
        
        Severity: Minor
        Found in example/html/web_socket.js - About 2 hrs to fix

          Function __createFlash has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            WebSocket.prototype.__createFlash = function(url, protocol, proxyHost, proxyPort, headers) {
              var self = this;
              self.__flash =
                WebSocket.__flash.create(url, protocol, proxyHost || null, proxyPort || 0, headers || null);
          
          
          Severity: Minor
          Found in example/html/web_socket.js - About 1 hr to fix

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

                deserialize: function(packedValue)
                {
            
                    var result;
            
            Severity: Minor
            Found in example/html/FABridge.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 deserialize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                deserialize: function(packedValue)
                {
            
                    var result;
            
            Severity: Minor
            Found in example/html/FABridge.js - About 1 hr to fix

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

                WebSocket.__initialize = function() {
                  if (WebSocket.__swfLocation) {
                    // For backword compatibility.
                    window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation;
                  }
              Severity: Minor
              Found in example/html/web_socket.js - About 1 hr to fix

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

                    serialize: function(value)
                    {
                        var result = {};
                
                        var t = typeof(value);
                Severity: Minor
                Found in example/html/FABridge.js - About 1 hr to fix

                  Function serialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      serialize: function(value)
                      {
                          var result = {};
                  
                          var t = typeof(value);
                  Severity: Minor
                  Found in example/html/FABridge.js - About 55 mins 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

                  Avoid deeply nested control flow statements.
                  Open

                                      if (param.nodeType == 1 && param.tagName.toLowerCase() == "param" && param["name"].toLowerCase() == "flashvars" && param["value"].indexOf(searchStr) >= 0) {
                                          FABridge.attachBridge(activeObjects[k], bridgeName);
                                              flash_found = true;
                                              break;
                                          }
                  Severity: Major
                  Found in example/html/FABridge.js - About 45 mins to fix

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

                      WebSocket.prototype.__createFlash = function(url, protocol, proxyHost, proxyPort, headers) {
                    Severity: Minor
                    Found in example/html/web_socket.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language