TryGhost/Ghost

View on GitHub
ghost/bootstrap-socket/lib/bootstrap-socket.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function connectAndSend has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports.connectAndSend = (socketAddress, message) => {
    // Very basic guard against bad calls
    if (!socketAddress || !socketAddress.host || !socketAddress.port || !logging || !logging.info || !logging.warn || !message) {
        return Promise.resolve();
    }
Severity: Major
Found in ghost/bootstrap-socket/lib/bootstrap-socket.js - About 2 hrs to fix

    Function connect has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            const connect = (options = {}) => {
                let wasResolved = false;
    
                const waitTimeout = setTimeout(() => {
                    logging.info('Bootstrap socket timed out.');
    Severity: Major
    Found in ghost/bootstrap-socket/lib/bootstrap-socket.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

          if (!socketAddress || !socketAddress.host || !socketAddress.port || !logging || !logging.info || !logging.warn || !message) {
              return Promise.resolve();
          }
      Severity: Major
      Found in ghost/bootstrap-socket/lib/bootstrap-socket.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status