benjamine/frame-channels

View on GitHub

Showing 97 of 165 total issues

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

  Assertion.prototype.throwException = function (fn) {
    expect(this.obj).to.be.a('function');

    var thrown = false
      , not = this.flags.not;
Severity: Minor
Found in public/build/test-bundle.js - About 1 hr to fix

    Function findWindow has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    Channel.prototype.findWindow = function () {
      if (this._window) {
        return this._window;
      }
      var target = this.options.target;
    Severity: Minor
    Found in src/channel.js - About 45 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

    Function write has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
    Severity: Minor
    Found in public/build/test-bundle.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (v) {
                                  partial.push(quote(k) + (gap ? ': ' : ':') + v);
                              }
      Severity: Major
      Found in public/build/test-bundle.js - About 45 mins to fix

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

        },{"./util/globals":10,"./util/mock-window":11}],9:[function(require,module,exports){
        require('./globals');
        
        var instanceCount = 0;
        
        
        Severity: Minor
        Found in public/build/test-bundle.js - About 45 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 (Assertion.prototype.hasOwnProperty(fn) && fn != name) {
                      this[name][fn] = bind(assertion[fn], assertion);
                    }
        Severity: Major
        Found in public/build/test-bundle.js - About 45 mins to fix

          Function 10 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          },{"./globals":10}],10:[function(require,module,exports){
          (function (global){
          
          global.when = function(){
            var args = Array.prototype.slice.apply(arguments);
          Severity: Minor
          Found in public/build/test-bundle.js - About 45 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 (v) {
                                      partial.push(quote(k) + (gap ? ': ' : ':') + v);
                                  }
          Severity: Major
          Found in public/build/test-bundle.js - About 45 mins to fix

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

            function writeUInt16 (buf, value, offset, littleEndian, noAssert) {
            Severity: Minor
            Found in public/build/test-bundle.js - About 35 mins to fix

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

              function waitMessageResponse(self, id, timeout, resolve, reject) {
              Severity: Minor
              Found in public/build/frame-channels.js - About 35 mins to fix

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

                function writeInt16 (buf, value, offset, littleEndian, noAssert) {
                Severity: Minor
                Found in public/build/test-bundle.js - About 35 mins to fix

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

                  function writeFloat (buf, value, offset, littleEndian, noAssert) {
                  Severity: Minor
                  Found in public/build/test-bundle.js - About 35 mins to fix

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

                    function writeInt32 (buf, value, offset, littleEndian, noAssert) {
                    Severity: Minor
                    Found in public/build/test-bundle.js - About 35 mins to fix

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

                      function writeDouble (buf, value, offset, littleEndian, noAssert) {
                      Severity: Minor
                      Found in public/build/test-bundle.js - About 35 mins to fix

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

                        function writeUInt32 (buf, value, offset, littleEndian, noAssert) {
                        Severity: Minor
                        Found in public/build/test-bundle.js - About 35 mins to fix

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

                          exports.read = function(buffer, offset, isLE, mLen, nBytes) {
                          Severity: Minor
                          Found in public/build/test-bundle.js - About 35 mins to fix

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

                            function waitMessageResponse(self, id, timeout, resolve, reject) {
                            Severity: Minor
                            Found in src/channel.js - About 35 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                        return stylize('' + value, 'regexp');
                              Severity: Major
                              Found in public/build/test-bundle.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return objEquiv(actual, expected);
                                Severity: Major
                                Found in public/build/test-bundle.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return actual == expected;
                                  Severity: Major
                                  Found in public/build/test-bundle.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language