<commit_before>'use strict';

let Promise = require('bluebird'),
  urlParser = require('url'),
  log = require('intel'),
  BmpRunner = require('./../bmp_runner'),
  harBuilder = require('../../support/har_builder'),
  trafficShapeParser = require('../../support/traffic_shape_parser');

class BmpDelegate {
  constructor(options) {
    this.trafficShapeConfig = trafficShapeParser.parseTrafficShapeConfig(options);
    this.createHar = !options.skipHar;

    if (this.trafficShapeConfig || options.basicAuth || this.createHar) {
      this.bmpRunner = new BmpRunner(options);
    } else {
      throw new Error('BmpDelegate incorrect options: ' + JSON.stringify(options, null, 2));
    }
  }

  onStart() {
    return this.bmpRunner.start();<commit_msg>Prefer early exit over if/else.<commit_after>'use strict';

let Promise = require('bluebird'),
  urlParser = require('url'),
  log = require('intel'),
  BmpRunner = require('./../bmp_runner'),
  harBuilder = require('../../support/har_builder'),
  trafficShapeParser = require('../../support/traffic_shape_parser');

class BmpDelegate {
  constructor(options) {
    this.trafficShapeConfig = trafficShapeParser.parseTrafficShapeConfig(options);
    this.createHar = !options.skipHar;

    if (!(this.trafficShapeConfig || options.basicAuth || this.createHar)) {
      throw new Error('BmpDelegate incorrect options: ' + JSON.stringify(options, null, 2));
    }

    this.bmpRunner = new BmpRunner(options);
  }

  onStart() {
    return this.bmpRunner.start();
{'fraction_non_alphanumeric': 0.15399867812293458, 'fraction_numerical': 0.0013218770654329147, 'mean_word_length': 4.167235494880546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001203', 'n_tokens_mistral': 452, 'n_tokens_neox': 446, 'n_words': 84}