<commit_before>/*global rg2:false */
(function () {
  function Result(data, isScoreEvent, scorecodes, scorex, scorey) {
    // resultid is the kartat id value
    this.resultid = data.resultid;
    this.rawid = this.resultid % rg2.config.GPS_RESULT_OFFSET;
    this.isScoreEvent = isScoreEvent;
    this.name = rg2.he.decode(data.name);
    this.initials = this.getInitials(this.name);
    this.starttime = data.starttime;
    this.time = data.time;
    this.position = data.position;
    this.status = data.status;
    // get round iconv problem in API for now: unescape special characters to get sensible text
    if (data.comments) {
      this.comments = rg2.he.decode(data.comments);
    } else {
      this.comments = "";
    }
    this.coursename = data.coursename;
    if (this.coursename === "") {
      this.coursename = data.courseid;
    }
    this.courseid = data.courseid;
    this.splits = data.splits;
    // insert a 0 split at the start to make life much easier elsewhere
    this.splits.splice(0, 0, 0);
    if (isScoreEvent) {
      // save control locations for score course result
      this.scorex = scorex;
      this.scorey = scorey;
      this.scorecodes = scorecodes;
    }
    this.initialiseTrack(data);
  }


  Result.prototype = {
    Constructor : Result,

    initialiseTrack : function (data) {
      var info;
      this.cumulativeDistance = [];
      this.legpos = [];
      // set true if track includes all expected controls in correct order or is a GPS track
      this.hasValidTrack = false;
      this.displayTrack = false;
      this.displayScoreCourse = false;
      this.trackColour = null;
      // raw track data
      this.trackx = [];
      this.tracky = [];
      this.speedColour = [];
      // interpolated times
      this.xysecs = [];
      // GPS track ids are normal resultid + GPS_RESULT_OFFSET
      if (this.resultid >= rg2.config.GPS_RESULT_OFFSET) {
        this.isGPSTrack = true;
        // don't get time or splits so need to copy them in from original result
        info = rg2.results.getTimeAndSplitsForID(this.rawid);
        this.time = info.time;
        this.splits = info.splits;
        // allow for events with no results where there won't be a non-GPS result
        if (this.time === rg2.config.TIME_NOT_FOUND) {
          this.time = data.time;
        }
      } else {
        //this.name = data.name;
        this.isGPSTrack = false;
      }
    },

    putTrackOnDisplay : function () {
      if (this.hasValidTrack) {
        this.trackColour = rg2.colours.getNextColour()
        this.displayTrack = true;
      }
    },

    removeTrackFromDisplay : function () {
      if (this.hasValidTrack) {
        this.trackColour = null;<commit_msg>Fix lint error: missing semcolon<commit_after>/*global rg2:false */
(function () {
  function Result(data, isScoreEvent, scorecodes, scorex, scorey) {
    // resultid is the kartat id value
    this.resultid = data.resultid;
    this.rawid = this.resultid % rg2.config.GPS_RESULT_OFFSET;
    this.isScoreEvent = isScoreEvent;
    this.name = rg2.he.decode(data.name);
    this.initials = this.getInitials(this.name);
    this.starttime = data.starttime;
    this.time = data.time;
    this.position = data.position;
    this.status = data.status;
    // get round iconv problem in API for now: unescape special characters to get sensible text
    if (data.comments) {
      this.comments = rg2.he.decode(data.comments);
    } else {
      this.comments = "";
    }
    this.coursename = data.coursename;
    if (this.coursename === "") {
      this.coursename = data.courseid;
    }
    this.courseid = data.courseid;
    this.splits = data.splits;
    // insert a 0 split at the start to make life much easier elsewhere
    this.splits.splice(0, 0, 0);
    if (isScoreEvent) {
      // save control locations for score course result
      this.scorex = scorex;
      this.scorey = scorey;
      this.scorecodes = scorecodes;
    }
    this.initialiseTrack(data);
  }


  Result.prototype = {
    Constructor : Result,

    initialiseTrack : function (data) {
      var info;
      this.cumulativeDistance = [];
      this.legpos = [];
      // set true if track includes all expected controls in correct order or is a GPS track
      this.hasValidTrack = false;
      this.displayTrack = false;
      this.displayScoreCourse = false;
      this.trackColour = null;
      // raw track data
      this.trackx = [];
      this.tracky = [];
      this.speedColour = [];
      // interpolated times
      this.xysecs = [];
      // GPS track ids are normal resultid + GPS_RESULT_OFFSET
      if (this.resultid >= rg2.config.GPS_RESULT_OFFSET) {
        this.isGPSTrack = true;
        // don't get time or splits so need to copy them in from original result
        info = rg2.results.getTimeAndSplitsForID(this.rawid);
        this.time = info.time;
        this.splits = info.splits;
        // allow for events with no results where there won't be a non-GPS result
        if (this.time === rg2.config.TIME_NOT_FOUND) {
          this.time = data.time;
        }
      } else {
        //this.name = data.name;
        this.isGPSTrack = false;
      }
    },

    putTrackOnDisplay : function () {
      if (this.hasValidTrack) {
        this.trackColour = rg2.colours.getNextColour();
        this.displayTrack = true;
      }
    },

    removeTrackFromDisplay : function () {
      if (this.hasValidTrack) {
        this.trackColour = null;
{'fraction_non_alphanumeric': 0.10907759882869693, 'fraction_numerical': 0.004392386530014641, 'mean_word_length': 2.314129775621589, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4571756', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1678, 'n_words': 421}