<commit_before>goog.provide('KeepMeContributing');

goog.require('KeepMeContributing.Defines');

// Manage the panel showing current contribution status.
goog.require('KeepMeContributing.ContributionStatus');
goog.require('KeepMeContributing.Github');
goog.require('KeepMeContributing.ContributionStatusView');
goog.require('KeepMeContributing.GithubProfileLinkedTextView');

// Manage the form to controll the worker to notify contribution status.
goog.require('KeepMeContributing.SchedulesController');
goog.require('KeepMeContributing.NotificationStatusStore');
goog.require('KeepMeContributing.SchedulesStore');
goog.require('KeepMeContributing.WorkerHandler');
goog.require('KeepMeContributing.NotificationScheduler');
goog.require('KeepMeContributing.SchedulesView');

goog.require('goog.dom');
goog.require('goog.ui.Button');
goog.require('goog.ui.Checkbox');

KeepMeContributing.start = () => {
  let kmc = KeepMeContributing;

  let /** string */ username = 'igrep';

  let /** string */ apiUrl = '';
  let /** KeepMeContributing.Github.Formats */ format = KeepMeContributing.Github.Formats.DEFAULT;
  if (KeepMeContributing.Defines.CORDOVA){
    apiUrl = 'https://keep-me-contributing.herokuapp.com/';

    // Seems my phone can't handle XML by some bug!
    format = KeepMeContributing.Github.Formats.JSON;
  }

  let /** KeepMeContributing.ContributionStatus? */ contributionStatus =
    new kmc.ContributionStatus(new kmc.Github({ username: username, format: format, apiUrl: apiUrl }));
  let /** ContributionStatusView */ statusView = new kmc.ContributionStatusView(
    username, contributionStatus
  );

  statusView.render(goog.dom.getElement('contributionStatus'));
  contributionStatus.startPolling(5 * 60 * 1000);

  new kmc.GithubProfileLinkedTextView('See ', username, "'s GitHub profile page for details.")
    .render(goog.dom.getElement('seeProfile'));

  let /** KeepMeContributing.SchedulesController */ controller = new kmc.SchedulesController();
  let /** KeepMeContributing.SchedulesStore */ store =
    new kmc.SchedulesStore('KeepMeContributing.SchedulesStore', controller);
  let /** KeepMeContributing.NotificationStatusStore */ notificationStatusStore =
    new kmc.NotificationStatusStore('KeepMeContributing.NotificationStatusStore');

  if (KeepMeContributing.Defines.CORDOVA){
    new kmc.NotificationScheduler(contributionStatus, controller);
  } else {
    // Relative path to worker.js from the loader document (index.html)
    new kmc.WorkerHandler(new Worker('js/worker.js'), controller);
  }<commit_msg>Refactor: delete verbose variable<commit_after>goog.provide('KeepMeContributing');

goog.require('KeepMeContributing.Defines');

// Manage the panel showing current contribution status.
goog.require('KeepMeContributing.ContributionStatus');
goog.require('KeepMeContributing.Github');
goog.require('KeepMeContributing.ContributionStatusView');
goog.require('KeepMeContributing.GithubProfileLinkedTextView');

// Manage the form to controll the worker to notify contribution status.
goog.require('KeepMeContributing.SchedulesController');
goog.require('KeepMeContributing.NotificationStatusStore');
goog.require('KeepMeContributing.SchedulesStore');
goog.require('KeepMeContributing.WorkerHandler');
goog.require('KeepMeContributing.NotificationScheduler');
goog.require('KeepMeContributing.SchedulesView');

goog.require('goog.dom');
goog.require('goog.ui.Button');
goog.require('goog.ui.Checkbox');

KeepMeContributing.start = () => {
  let kmc = KeepMeContributing;

  let /** string */ username = 'igrep';

  let /** string */ apiUrl = '';
  let /** KeepMeContributing.Github.Formats */ format = KeepMeContributing.Github.Formats.DEFAULT;
  if (KeepMeContributing.Defines.CORDOVA){
    apiUrl = 'https://keep-me-contributing.herokuapp.com/';

    // Seems my phone can't handle XML by some bug!
    format = KeepMeContributing.Github.Formats.JSON;
  }

  let /** KeepMeContributing.ContributionStatus? */ contributionStatus =
    new kmc.ContributionStatus(new kmc.Github({ username: username, format: format, apiUrl: apiUrl }));
  new kmc.ContributionStatusView(
    username, contributionStatus
  ).render(goog.dom.getElement('contributionStatus'));
  contributionStatus.startPolling(5 * 60 * 1000);

  new kmc.GithubProfileLinkedTextView('See ', username, "'s GitHub profile page for details.")
    .render(goog.dom.getElement('seeProfile'));

  let /** KeepMeContributing.SchedulesController */ controller = new kmc.SchedulesController();
  let /** KeepMeContributing.SchedulesStore */ store =
    new kmc.SchedulesStore('KeepMeContributing.SchedulesStore', controller);
  let /** KeepMeContributing.NotificationStatusStore */ notificationStatusStore =
    new kmc.NotificationStatusStore('KeepMeContributing.NotificationStatusStore');

  if (KeepMeContributing.Defines.CORDOVA){
    new kmc.NotificationScheduler(contributionStatus, controller);
  } else {
    // Relative path to worker.js from the loader document (index.html)
    new kmc.WorkerHandler(new Worker('js/worker.js'), controller);
  }
{'fraction_non_alphanumeric': 0.1258409180846854, 'fraction_numerical': 0.002770083102493075, 'mean_word_length': 5.868206521739131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1666912', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1449, 'n_words': 262}