<commit_before><script>
import mixins from './mixins.js'
import Progress from './Progress.vue'

export default {
  mixins: [
    mixins.stats
  ],
  components: { Progress },
  mounted () {
    this.$store.dispatch('calc_stats')
  },
  computed: {
    check_name () {
      return this.$route.params.check
    },
    check () {
      if (!this.stats || !this.stats.loaded) {
        return null
      }
      // Shallow clone to trigger Vue js reactivity on deeply nested objects
      return Object.assign({}, this.$store.state.stats.checks[this.check_name])
    }
  }
}
</script>

<template>
  <div>
    <Progress :name="'Check ' + check_name" />

    <div v-if="stats">
      <table class="table is-fullwidth" v-if="check">
        <thead>
          <tr>
            <th>Task</th>
            <th>Review</th>
            <th>Path</th>
            <th>Line</th>
            <th>Message</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="issue in check.issues">
            <td>
              <a class="mono" :href="'https://tools.taskcluster.net/task-inspector/#' + issue.taskId" target="_blank">{{ issue.taskId }}</a>
            </td>
            <td>
              <a :href="issue.revision.url" target="_blank" v-if="issue.revision.source == 'phabricator'">Phabricator {{ issue.revision.id }}</a>
              <span v-else>Unknown</span>
            </td>
            <td class="mono">{{ issue.path }}</td>
            <td>{{ issue.line }}</td>
            <td>
              <pre>{{ issue.message }}</pre>
            </td>
          </tr>
        </tbody>

      </table>
      <p v-else class="notification is-warning">No data available for this check</p>
    </div>
    <div class="notification is-info" v-else>Loading tasks...</div>
  </div>
</template>

<style>
.mono{
  font-family: monospace;
}
</style>
<commit_msg>staticanalysis/frontend: Fix source unknown in Check vue (#2029)<commit_after><script>
import mixins from './mixins.js'
import Progress from './Progress.vue'

export default {
  mixins: [
    mixins.stats
  ],
  components: { Progress },
  mounted () {
    this.$store.dispatch('calc_stats')
  },
  computed: {
    check_name () {
      return this.$route.params.check
    },
    check () {
      if (!this.stats || !this.stats.loaded) {
        return null
      }
      // Shallow clone to trigger Vue js reactivity on deeply nested objects
      return Object.assign({}, this.$store.state.stats.checks[this.check_name])
    }
  }
}
</script>

<template>
  <div>
    <Progress :name="'Check ' + check_name" />

    <div v-if="stats">
      <table class="table is-fullwidth" v-if="check">
        <thead>
          <tr>
            <th>Task</th>
            <th>Review</th>
            <th>Bug</th>
            <th>Path</th>
            <th>Line</th>
            <th>Message</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="issue in check.issues">
            <td>
              <a class="mono" :href="'https://tools.taskcluster.net/task-inspector/#' + issue.taskId" target="_blank">{{ issue.taskId }}</a>
            </td>
            <td>
              <a :href="issue.revision.url" target="_blank">D{{ issue.revision.id }}</a>
            </td>
            <td>
              <span v-if="issue.revision.bugzilla_id"><a :href="'https://bugzil.la/' + issue.revision.bugzilla_id" target="_blank">Bug {{ issue.revision.bugzilla_id }}</a></span>
              <span v-else>Unknown</span>
            </td>
            <td class="mono">{{ issue.path }}</td>
            <td>{{ issue.line }}</td>
            <td>
              <pre>{{ issue.message }}</pre>
            </td>
          </tr>
        </tbody>

      </table>
      <p v-else class="notification is-warning">No data available for this check</p>
    </div>
    <div class="notification is-info" v-else>Loading tasks...</div>
  </div>
</template>

<style>
.mono{
  font-family: monospace;
}
</style>

{'fraction_non_alphanumeric': 0.17711240801826947, 'fraction_numerical': 0.0010149708195889369, 'mean_word_length': 1.896399706098457, 'pattern_counts': {'":': 0, '<': 117, '<?xml version=': 0, '>': 117, 'https://': 3, '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': '6707805', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1271, 'n_words': 263}