Showing 30 of 111 total issues

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

module.exports = function (opts, req, socket, head, done) {
Severity: Minor
Found in lib/protocols/ws/passes/forward.js - About 35 mins to fix

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

        rockyStub.mw = { run: function (a, b, c, d, next) { next() } }
    Severity: Minor
    Found in test/server/server.js - About 35 mins to fix

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

      module.exports = function (opts, res, task, done, onRetry) {
      Severity: Minor
      Found in lib/protocols/http/retry.js - About 35 mins to fix

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

        function replayer (route, replayReq, replayRes, opts, next) {
        Severity: Minor
        Found in lib/protocols/http/passes/replay.js - About 35 mins to fix

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

          function replayHandler (route, params, opts, req, next) {
          Severity: Minor
          Found in lib/protocols/http/passes/replay.js - About 35 mins to fix

            Function replayer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function replayer (route, replayReq, replayRes, opts, next) {
              return function doReplay (err) {
                if (err) {
                  return route.emit('replay:error', err, replayReq, replayRes)
                }
            Severity: Minor
            Found in lib/protocols/http/passes/replay.js - About 35 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 dispatch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            Dispatcher.prototype.dispatch = function (req, res, next) {
              if (this.route.unregistered) return next('route')
            
              const route = this.route
              const opts = this.options()
            Severity: Minor
            Found in lib/protocols/http/dispatcher.js - About 35 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 concurrently has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.concurrently = function (args, done) {
              var pending = exports.passes.length
            
              function finish (err, res) {
                if (err) return done(err)
            Severity: Minor
            Found in lib/protocols/http/passes/index.js - About 35 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 setRequestParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function setRequestParams (req, opts) {
              const target = req.rocky.options.target || opts.target
              const url = parseUrl(target)
              const params = setupReq(opts.ssl || {}, opts, req)
            
            
            Severity: Minor
            Found in lib/protocols/http/passes/replay.js - About 25 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 defineHostHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            function defineHostHeader (forwardReq, opts) {
              const forwardHost = opts.forwardHost
              if (!forwardHost) return
            
              const headers = forwardReq.headers
            Severity: Minor
            Found in lib/protocols/http/passes/forward.js - About 25 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

            Severity
            Category
            Status
            Source
            Language