function startCodePath(origin) {
    if (codePath) {
      // Emits onCodePathSegmentStart events if updated.
      forwardCurrentToHead(analyzer, node);
    }

    // Create the code path of this scope.
    codePath = analyzer.codePath = new CodePath({
      id: analyzer.idGenerator.next(),
      origin,
      upper: codePath,
      onLooped: analyzer.onLooped,
    });
    state = CodePath.getState(codePath);

    // Emits onCodePathStart events.
    analyzer.emitter.emit('onCodePathStart', codePath, node);
  }
Creates a new code path and trigger the onCodePathStart event
based on the currently selected node.
@param {string} origin The reason the code path was started.
@returns {void}