Explorar o código

[192-webreport] eslint

Evgeni %!s(int64=4) %!d(string=hai) anos
pai
achega
676204e41f

+ 1 - 1
report-viewer/src/App.vue

@@ -1,5 +1,5 @@
 <template>
-  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
   <router-view/>
 </template>
 

+ 16 - 14
report-viewer/src/components/ClusterRadarChart.vue

@@ -1,23 +1,24 @@
 <template>
-<div class="wrapper">
-  <select v-model="selectedMember">
-    <option v-for="(member, index) in Object.keys(cluster.members)" :key="index">{{ member }}</option>
-  </select>
-  <RadarChart class="chart" :chartData="chartData" :options="options"></RadarChart>
-</div>
+  <div class="wrapper">
+    <select v-model="selectedMember">
+      <option v-for="(member, index) in Object.keys(cluster.members)" :key="index">{{ member }}</option>
+    </select>
+    <RadarChart :chartData="chartData" :options="options" class="chart"></RadarChart>
+  </div>
 </template>
 
 <script>
-import { defineComponent, ref, watch } from "vue";
-import { RadarChart } from "vue-chart-3"
-import { Chart, registerables } from 'chart.js';
+import {defineComponent, ref, watch} from "vue";
+import {RadarChart} from "vue-chart-3"
+import {Chart, registerables} from 'chart.js';
 import ChartDataLabels from 'chartjs-plugin-datalabels';
+
 Chart.register(...registerables);
 Chart.register(ChartDataLabels);
 
 export default defineComponent({
   name: "ClusterRadarChart",
-  components: { RadarChart },
+  components: {RadarChart},
   props: {
     cluster: {}
   },
@@ -27,12 +28,12 @@ export default defineComponent({
 
     const createLabelsFor = (member) => {
       let matchedWith = []
-      props.cluster.members[member].forEach( m => matchedWith.push(m.matchedWith))
+      props.cluster.members[member].forEach(m => matchedWith.push(m.matchedWith))
       return matchedWith
     }
     const createDataSetFor = (member) => {
       let data = []
-      props.cluster.members[member].forEach( m => data.push(m.percentage))
+      props.cluster.members[member].forEach(m => data.push(m.percentage))
       return data
     }
 
@@ -52,14 +53,15 @@ export default defineComponent({
     })
 
     const options = ref({
-      scales: { r: {
+      scales: {
+        r: {
           suggestedMin: 50,
           suggestedMax: 100
         }
       }
     })
 
-    watch( () => selectedMember.value, (val) => {
+    watch(() => selectedMember.value, (val) => {
       chartData.value = {
         labels: createLabelsFor(val),
         datasets: [{

+ 11 - 11
report-viewer/src/components/ClustersList.vue

@@ -1,24 +1,24 @@
 <template>
   <div class="wrapper">
-  <h1>Clusters for comparison {{ comparison.firstSubmissionId }} > {{ comparison.secondSubmissionId}}</h1>
-  <p v-for="( cluster, index ) in clusters" :key="index" @click="toggleDialog">
-    {{index}} - {{cluster.average_similarity}}
-    <GDialog v-model="dialog" fullscreen>
-      <button @click="toggleDialog">Close</button>
-      <ClusterRadarChart :cluster="cluster"></ClusterRadarChart>
-    </GDialog>
-  </p>
+    <h1>Clusters for comparison {{ comparison.firstSubmissionId }} > {{ comparison.secondSubmissionId }}</h1>
+    <p v-for="( cluster, index ) in clusters" :key="index" @click="toggleDialog">
+      {{ index }} - {{ cluster.average_similarity }}
+      <GDialog v-model="dialog" fullscreen>
+        <button @click="toggleDialog">Close</button>
+        <ClusterRadarChart :cluster="cluster"></ClusterRadarChart>
+      </GDialog>
+    </p>
   </div>
 </template>
 
 <script>
-import  { defineComponent, ref } from "vue";
-import { GDialog } from "gitart-vue-dialog";
+import {defineComponent, ref} from "vue";
+import {GDialog} from "gitart-vue-dialog";
 import ClusterRadarChart from "@/components/ClusterRadarChart";
 
 export default defineComponent({
   name: "ClustersList",
-  components: {ClusterRadarChart, GDialog },
+  components: {ClusterRadarChart, GDialog},
   props: {
     comparison: {},
     clusters: Array

+ 21 - 18
report-viewer/src/components/CodePanel.vue

@@ -1,30 +1,31 @@
 <template>
-  <div class="code-panel-container" :id="panelId.toString().concat(title).concat(fileIndex.toString())">
+  <div :id="panelId.toString().concat(title).concat(fileIndex.toString())" class="code-panel-container">
     <div class="file-title">
       <p style="width: 90%">{{ title }}</p>
-      <button style="width: 10%" class="collapse-button" @click="$emit('toggleCollapse')">
-        <img v-if="collapse" src="../assets/keyboard_double_arrow_up_black_18dp.svg" alt="hide info">
-        <img v-else src="../assets/keyboard_double_arrow_down_black_18dp.svg" alt="additional info">
+      <button class="collapse-button" style="width: 10%" @click="$emit('toggleCollapse')">
+        <img v-if="collapse" alt="hide info" src="../assets/keyboard_double_arrow_up_black_18dp.svg">
+        <img v-else alt="additional info" src="../assets/keyboard_double_arrow_down_black_18dp.svg">
       </button>
     </div>
-    <div class="code-container" :class="{ hidden : !collapse }">
+    <div :class="{ hidden : !collapse }" class="code-container">
       <LineOfCode v-for="(line, index) in lines"
+                  :id="String(panelId).concat(title).concat(index)"
+                  :key="index"
+                  :color="coloringArray[index]"
+                  :is-first="isFirst[index]"
+                  :is-last="isLast[index]"
+                  :line-number="index"
+                  :text="line"
                   :visible="collapse"
-                :key="index"
-                :color="coloringArray[index]"
-                :line-number="index"
-                :text="line"
-                :id="String(panelId).concat(title).concat(index)"
-                :is-last="isLast[index]"
-                :is-first="isFirst[index]"
                   @click="$emit('lineSelected', $event, linksArray[index].panel, linksArray[index].file, linksArray[index].line )"/>
     </div>
   </div>
 </template>
 
 <script>
-import {ref, defineComponent} from "vue";
+import {defineComponent, ref} from "vue";
 import LineOfCode from "./LineOfCode";
+
 export default defineComponent({
   name: "CodePanel",
   components: {LineOfCode},
@@ -117,20 +118,20 @@ export default defineComponent({
         //assign match color to line
         coloringArray.value[i] = m.color
         //assign link object to line.
-        linksArray.value[i] = { panel : m.linked_panel, file : m.linked_file, line : m.linked_line }
+        linksArray.value[i] = {panel: m.linked_panel, file: m.linked_file, line: m.linked_line}
         //check whether line is start of match and assign true if yes
-        if(i === m.start) {
+        if (i === m.start) {
           isFirst.value[i] = true
         }
         //check whether line is end of match and assign true if yes
-        if(i === m.end) {
+        if (i === m.end) {
           isLast.value[i] = true
         }
       }
     })
     //assign default values for all line which are not contained in matches
-    for(let i = 0; i < props.lines.length; i++) {
-      if(!coloringArray.value[i]) {
+    for (let i = 0; i < props.lines.length; i++) {
+      if (!coloringArray.value[i]) {
         coloringArray.value[i] = "#FFFFFF"
         linksArray.value[i] = "-1"
         isFirst.value[i] = false
@@ -159,6 +160,7 @@ export default defineComponent({
   box-shadow: var(--shadow-color) 2px 3px 3px;
   background: var(--primary-color-light);
 }
+
 .file-title {
   display: flex;
 }
@@ -169,6 +171,7 @@ export default defineComponent({
   font-weight: bold;
   font-size: large;
 }
+
 .code-container {
   display: flex;
   flex-direction: column;

+ 63 - 59
report-viewer/src/components/ComparisonsTable.vue

@@ -1,68 +1,72 @@
 <template>
-<table>
-  <tr class="head-row">
-    <th>No.</th>
-    <th>Submission 1</th>
-    <th></th>
-    <th>Submission 2</th>
-    <th>Match %</th>
-  </tr>
-  <tr v-for="(comparison, index) in topComparisons"
-      :key="comparison.firstSubmissionId
+  <table>
+    <tr class="head-row">
+      <th>No.</th>
+      <th>Submission 1</th>
+      <th></th>
+      <th>Submission 2</th>
+      <th>Match %</th>
+    </tr>
+    <tr v-for="(comparison, index) in topComparisons"
+        :key="comparison.firstSubmissionId
             + comparison.secondSubmissionId
             + comparison.matchPercentage"
-      class="selectable"
-      >
-
-    <td  @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">{{ index + 1 }}.</td>
-    <td :class="{ 'anonymous-style' : isAnonymous(comparison.firstSubmissionId)}"
-        @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
-      {{ isAnonymous(comparison.firstSubmissionId) ? "Hidden" : comparison.firstSubmissionId  }}
-    </td>
-    <td
-        @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
-      <img src="@/assets/double_arrow_black_18dp.svg" alt=">>"/>
-    </td>
-    <td :class="{ 'anonymous-style' : isAnonymous(comparison.secondSubmissionId)}"
-        @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
-      {{ isAnonymous(comparison.secondSubmissionId) ? "Hidden" : comparison.secondSubmissionId }}
-    </td>
-    <td>{{ formattedMatchPercentage(comparison.matchPercentage) }}</td>
-    <td>
-      <img v-if="isInCluster(comparison.firstSubmissionId, comparison.secondSubmissionId)"
-           src="@/assets/keyboard_double_arrow_down_black_18dp.svg"
-           alt=">>"
-           @click="toggleDialog"
-      />
-    </td>
-    <GDialog v-model="dialog">
-      <ClustersList :clusters="getClustersFor(comparison.firstSubmissionId, comparison.secondSubmissionId)" :comparison="comparison"/>
-    </GDialog>
-  </tr>
-</table>
+        class="selectable"
+    >
+
+      <td @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">{{
+          index + 1
+        }}.
+      </td>
+      <td :class="{ 'anonymous-style' : isAnonymous(comparison.firstSubmissionId)}"
+          @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
+        {{ isAnonymous(comparison.firstSubmissionId) ? "Hidden" : comparison.firstSubmissionId }}
+      </td>
+      <td
+          @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
+        <img alt=">>" src="@/assets/double_arrow_black_18dp.svg"/>
+      </td>
+      <td :class="{ 'anonymous-style' : isAnonymous(comparison.secondSubmissionId)}"
+          @click="navigateToComparisonView(comparison.firstSubmissionId, comparison.secondSubmissionId)">
+        {{ isAnonymous(comparison.secondSubmissionId) ? "Hidden" : comparison.secondSubmissionId }}
+      </td>
+      <td>{{ formattedMatchPercentage(comparison.matchPercentage) }}</td>
+      <td>
+        <img v-if="isInCluster(comparison.firstSubmissionId, comparison.secondSubmissionId)"
+             alt=">>"
+             src="@/assets/keyboard_double_arrow_down_black_18dp.svg"
+             @click="toggleDialog"
+        />
+      </td>
+      <GDialog v-model="dialog">
+        <ClustersList :clusters="getClustersFor(comparison.firstSubmissionId, comparison.secondSubmissionId)"
+                      :comparison="comparison"/>
+      </GDialog>
+    </tr>
+  </table>
 </template>
 
 <script>
 import {defineComponent, ref} from "vue";
 import router from "@/router";
 import store from "@/store/store";
-import { GDialog } from "gitart-vue-dialog";
+import {GDialog} from "gitart-vue-dialog";
 import ClustersList from "@/components/ClustersList";
 
 export default defineComponent({
   name: "ComparisonsTable",
-  components: {ClustersList, GDialog },
+  components: {ClustersList, GDialog},
   props: {
-   topComparisons : {
-     type: Array,
-     required: true
-   },
-    clusters : {
-     type: Array
+    topComparisons: {
+      type: Array,
+      required: true
+    },
+    clusters: {
+      type: Array
     }
   },
   setup(props) {
-    let formattedMatchPercentage = ( number ) => number.toFixed(2)
+    let formattedMatchPercentage = (number) => number.toFixed(2)
     const dialog = ref(false)
 
     const toggleDialog = () => {
@@ -70,7 +74,7 @@ export default defineComponent({
     }
 
     const navigateToComparisonView = (firstId, secondId) => {
-      if(!store.state.single) {
+      if (!store.state.single) {
         router.push({
           name: "ComparisonView",
           query: {firstId: firstId, secondId: secondId},
@@ -79,7 +83,7 @@ export default defineComponent({
     }
 
     const isInCluster = (id1, id2) => {
-      return props.clusters.some( c => c.members.includes(id1) && c.members.includes(id2))
+      return props.clusters.some(c => c.members.includes(id1) && c.members.includes(id2))
     }
 
     const isAnonymous = (id) => {
@@ -89,19 +93,19 @@ export default defineComponent({
 
     const getParticipatingMatchesForId = (id, others) => {
       let matches = []
-      props.topComparisons.forEach( comparison => {
-        if(comparison.firstSubmissionId.includes(id)  && others.includes(comparison.secondSubmissionId)) {
-          matches.push({ matchedWith: comparison.secondSubmissionId, percentage: comparison.matchPercentage})
-        } else if ( comparison.secondSubmissionId.includes(id) && others.includes(comparison.firstSubmissionId)) {
-          matches.push({ matchedWith: comparison.firstSubmissionId, percentage: comparison.matchPercentage})
+      props.topComparisons.forEach(comparison => {
+        if (comparison.firstSubmissionId.includes(id) && others.includes(comparison.secondSubmissionId)) {
+          matches.push({matchedWith: comparison.secondSubmissionId, percentage: comparison.matchPercentage})
+        } else if (comparison.secondSubmissionId.includes(id) && others.includes(comparison.firstSubmissionId)) {
+          matches.push({matchedWith: comparison.firstSubmissionId, percentage: comparison.matchPercentage})
         }
       })
       return matches;
     }
 
-    const clustersWithParticipatingMatches = props.clusters.map( cluster => {
+    const clustersWithParticipatingMatches = props.clusters.map(cluster => {
       let membersArray = {}
-      cluster.members.forEach( member => {
+      cluster.members.forEach(member => {
         let others = cluster.members.filter(m => !m.includes(member))
         membersArray[member] = getParticipatingMatchesForId(member, others)
       })
@@ -113,8 +117,8 @@ export default defineComponent({
     })
 
     const getClustersFor = (id1, id2) => {
-      return clustersWithParticipatingMatches.filter( c => Object.keys(c.members).includes(id1) &&
-                                                                Object.keys(c.members).includes(id2))
+      return clustersWithParticipatingMatches.filter(c => Object.keys(c.members).includes(id1)
+          && Object.keys(c.members).includes(id2))
     }
 
     return {

+ 17 - 16
report-viewer/src/components/DistributionDiagram.vue

@@ -1,20 +1,21 @@
 <template>
   <div class="wrapper">
-    <BarChart class="chart" :chartData="chartData" :options="options"/>
+    <BarChart :chartData="chartData" :options="options" class="chart"/>
   </div>
 </template>
 
 <script>
 import {defineComponent, ref, watch} from "vue";
-import { BarChart } from "vue-chart-3"
-import { Chart, registerables } from 'chart.js';
+import {BarChart} from "vue-chart-3"
+import {Chart, registerables} from 'chart.js';
 import ChartDataLabels from 'chartjs-plugin-datalabels';
+
 Chart.register(...registerables);
 Chart.register(ChartDataLabels);
 
 export default defineComponent({
   name: "DistributionDiagram",
-  components: { BarChart },
+  components: {BarChart},
   props: {
     distribution: {
       type: Array,
@@ -26,16 +27,16 @@ export default defineComponent({
     //otherwise maximum is set to the highest count of submissions and is one bar always reaches the end.
     let maxVal = ref(Math.max(...props.distribution));
 
-    let chartData = ref( {
-        labels: ['0-10%', '11-20%', '21-30%', '31-40%', '41-50%', '51-60%', '61-70%', '71-80%', '81-90%', '91-100%'],
-        datasets: [{
-          label: 'Count',
-          data: props.distribution,
-          backgroundColor: 'rgba(149, 168, 241, 0.5)',
-          borderWidth: 2,
-          borderColor: 'rgba(149, 168, 241, 1)',
-          tickColor: '#000000'
-        }]
+    let chartData = ref({
+      labels: ['0-10%', '11-20%', '21-30%', '31-40%', '41-50%', '51-60%', '61-70%', '71-80%', '81-90%', '91-100%'],
+      datasets: [{
+        label: 'Count',
+        data: props.distribution,
+        backgroundColor: 'rgba(149, 168, 241, 0.5)',
+        borderWidth: 2,
+        borderColor: 'rgba(149, 168, 241, 1)',
+        tickColor: '#000000'
+      }]
     })
 
     const options = ref({
@@ -55,7 +56,7 @@ export default defineComponent({
           }
         }
       },
-      plugins : {
+      plugins: {
         datalabels: {
           color: '#000000',
           font: {
@@ -73,7 +74,7 @@ export default defineComponent({
 
     //We watch the given distributions parameter. When the distribution of another metric is passed, the diagram is
     //updated with the new data.
-    watch( () => props.distribution, (val) => {
+    watch(() => props.distribution, (val) => {
       chartData.value = {
         labels: ['0-10%', '11-20%', '21-30%', '31-40%', '41-50%', '51-60%', '61-70%', '71-80%', '81-90%', '91-100%'],
         datasets: [{

+ 10 - 9
report-viewer/src/components/FilesContainer.vue

@@ -3,28 +3,28 @@
     <h1>Files of {{ filesOwner }}</h1>
     <VueDraggableNext>
       <CodePanel v-for="(file, index) in Object.keys(files)"
-                 :lines="files[file].lines"
-                 :title="file"
-                 :file-index="index"
-                 :matches="!matches[file] ? [] : matches[file]"
                  :key="file.concat(index)"
                  :collapse="files[file].collapsed"
+                 :file-index="index"
+                 :lines="files[file].lines"
+                 :matches="!matches[file] ? [] : matches[file]"
+                 :panel-id="containerId"
+                 :title="file"
                  @toggle-collapse="$emit('toggle-collapse', file)"
                  @line-selected="lineSelected"
-                 :panel-id="containerId"
       />
     </VueDraggableNext>
   </div>
 </template>
 
 <script>
-import { defineComponent } from "vue";
+import {defineComponent} from "vue";
 import CodePanel from "@/components/CodePanel";
-import { VueDraggableNext } from "vue-draggable-next"
+import {VueDraggableNext} from "vue-draggable-next"
 
 export default defineComponent({
   name: "FilesContainer",
-  components: { CodePanel, VueDraggableNext},
+  components: {CodePanel, VueDraggableNext},
   props: {
     /**
      * Id of the files container. We have only two so it is either 1 or 2.
@@ -57,7 +57,7 @@ export default defineComponent({
     }
   },
 
-  setup(props, { emit }) {
+  setup(props, {emit}) {
 
     /**
      * Passes lineSelected event, emitted from LineOfCode, to parent.
@@ -80,6 +80,7 @@ export default defineComponent({
 h1 {
   text-align: center;
 }
+
 .files-container {
   display: flex;
   flex-wrap: nowrap;

+ 8 - 8
report-viewer/src/components/IDsList.vue

@@ -1,16 +1,16 @@
 <template>
-<div class="container">
-  <div class="column-list">
-    <p v-for="(id, index) in ids" :key="index" @click="$emit('idSent', [id])">
-      {{ id }}
-    </p>
+  <div class="container">
+    <div class="column-list">
+      <p v-for="(id, index) in ids" :key="index" @click="$emit('idSent', [id])">
+        {{ id }}
+      </p>
+    </div>
+    <button @click="$emit('idSent', ids)">Hide/Show all</button>
   </div>
-  <button @click="$emit('idSent', ids)">Hide/Show all</button>
-</div>
 </template>
 
 <script>
-import { defineComponent } from "vue";
+import {defineComponent} from "vue";
 
 export default defineComponent({
   name: "IDsList",

+ 13 - 7
report-viewer/src/components/LineOfCode.vue

@@ -1,6 +1,9 @@
 <template>
-  <div class="line-wrap" :style="{background : color}" :class="{'first-line' : isFirst, 'last-line' : isLast, 'visible' : visible}">
-    <pre ref="lineRef" :id="text" class="java" :class="{ 'match-line' : color !== '#ECECEC' }">{{ lineNumber }} {{ text }}</pre>
+  <div :class="{'first-line' : isFirst, 'last-line' : isLast, 'visible' : visible}" :style="{background : color}"
+       class="line-wrap">
+    <pre :id="text" ref="lineRef" :class="{ 'match-line' : color !== '#ECECEC' }" class="java">{{ lineNumber }} {{
+        text
+      }}</pre>
   </div>
 </template>
 
@@ -27,7 +30,7 @@ export default defineComponent({
       required: true
     },
     color: {
-      required:true
+      required: true
     },
     fileIndex: {
       type: Number,
@@ -44,10 +47,10 @@ export default defineComponent({
     let highlighted = false
     let lineRef = ref(null)
     //Trigger highlighting when code panel is collapsed.
-    onUpdated( () => {
-      if ( props.visible && !highlighted ) {
-          hljs.highlightElement(lineRef.value)
-          highlighted = true
+    onUpdated(() => {
+      if (props.visible && !highlighted) {
+        hljs.highlightElement(lineRef.value)
+        highlighted = true
       }
     })
     return {
@@ -70,12 +73,15 @@ pre {
 .first-line {
   margin-top: 2%;
 }
+
 .last-line {
   margin-bottom: 2%;
   box-shadow: #777777 0 3px 3px;
 }
+
 .match-line {
 }
+
 .line-wrap {
   width: 200%;
 }

+ 33 - 32
report-viewer/src/components/MatchTable.vue

@@ -1,38 +1,39 @@
 <template>
-<div class="match-table-container">
-  <table>
-    <tr>
-      <th>Submission 1</th>
-      <th>Submission 2</th>
-    </tr>
-    <tr>
-      <th>File 1</th>
-      <th>File 2</th>
-      <th>Tokens</th>
-    </tr>
-    <tr v-for="( match, index ) in matches" :key="String(index).concat(match.startInFirst).concat(match.startInSecond)"
-        @click="$emit('matchSelected', $event, match)"
-        :style="{ background : match.color }">
-      <td>
-        <div class="td-content">
-          <p>{{ match.firstFile }}</p>
-          <p>({{ match.startInFirst }} - {{ match.endInFirst }})</p>
-        </div>
-      </td>
-      <td>
-        <div class="td-content">
-          <p>{{ match.secondFile }}</p>
-          <p>({{ match.startInSecond }} - {{ match.endInSecond }})</p>
-        </div>
-      </td>
-      <td>{{ match.tokens }}</td>
-    </tr>
-  </table>
-</div>
+  <div class="match-table-container">
+    <table>
+      <tr>
+        <th>Submission 1</th>
+        <th>Submission 2</th>
+      </tr>
+      <tr>
+        <th>File 1</th>
+        <th>File 2</th>
+        <th>Tokens</th>
+      </tr>
+      <tr v-for="( match, index ) in matches"
+          :key="String(index).concat(match.startInFirst).concat(match.startInSecond)"
+          :style="{ background : match.color }"
+          @click="$emit('matchSelected', $event, match)">
+        <td>
+          <div class="td-content">
+            <p>{{ match.firstFile }}</p>
+            <p>({{ match.startInFirst }} - {{ match.endInFirst }})</p>
+          </div>
+        </td>
+        <td>
+          <div class="td-content">
+            <p>{{ match.secondFile }}</p>
+            <p>({{ match.startInSecond }} - {{ match.endInSecond }})</p>
+          </div>
+        </td>
+        <td>{{ match.tokens }}</td>
+      </tr>
+    </table>
+  </div>
 </template>
 
 <script>
-import { defineComponent } from "vue";
+import {defineComponent} from "vue";
 
 export default defineComponent({
   name: "MatchTable",
@@ -41,7 +42,7 @@ export default defineComponent({
      * Matches of the comparison.
      * type: Array<Match>
      */
-    matches : {
+    matches: {
       type: Array
     },
     /**

+ 10 - 10
report-viewer/src/components/MetricButton.vue

@@ -1,14 +1,14 @@
 <template>
-<div class="wrapper" v-bind:class="{ selected : isSelected }">
-  <div class="metric">
-    <p class="metric-name">{{ metricName }}</p>
-    <img src="@/assets/help_outline_black_18dp.svg" alt="?"/>
+  <div class="wrapper" v-bind:class="{ selected : isSelected }">
+    <div class="metric">
+      <p class="metric-name">{{ metricName }}</p>
+      <img alt="?" src="@/assets/help_outline_black_18dp.svg"/>
+    </div>
+    <div class="threshold">
+      <p>Threshold: </p>
+      <p>{{ metricThreshold }}%</p>
+    </div>
   </div>
-  <div class="threshold">
-    <p>Threshold: </p>
-    <p>{{ metricThreshold }}%</p>
-  </div>
-</div>
 </template>
 
 <script>
@@ -25,7 +25,7 @@ export default defineComponent({
       type: Number,
       required: true
     },
-    isSelected : {
+    isSelected: {
       type: Boolean,
       default: false
     },

+ 10 - 9
report-viewer/src/components/TextInformation.vue

@@ -1,15 +1,16 @@
 <template>
   <div class="wrapper">
-      <div class="text-container">
+    <div class="text-container">
       <p class="label-text">{{ label }}</p>
-      <p :class="{ 'anonymous' : anonymous }" class="value-text" :title="anonymous ? '' : value">{{ anonymous ? "Hidden" : value }}</p>
-      </div>
-      <button class="collapse-button" :class="{ hidden : !hasAdditionalInfo }" @click="toggleIsCollapsed">
-        <img v-if="isCollapsed" src="../assets/keyboard_double_arrow_up_black_18dp.svg" alt="hide info">
-        <img v-else src="../assets/keyboard_double_arrow_down_black_18dp.svg" alt="additional info">
-      </button>
+      <p :class="{ 'anonymous' : anonymous }" :title="anonymous ? '' : value" class="value-text">
+        {{ anonymous ? "Hidden" : value }}</p>
+    </div>
+    <button :class="{ hidden : !hasAdditionalInfo }" class="collapse-button" @click="toggleIsCollapsed">
+      <img v-if="isCollapsed" alt="hide info" src="../assets/keyboard_double_arrow_up_black_18dp.svg">
+      <img v-else alt="additional info" src="../assets/keyboard_double_arrow_down_black_18dp.svg">
+    </button>
   </div>
-  <div class="additional-info" :class="{ hidden : !isCollapsed }">
+  <div :class="{ hidden : !isCollapsed }" class="additional-info">
     <p class="additional-info-title">{{ additionalInfoTitle }}</p>
     <slot></slot>
   </div>
@@ -125,7 +126,7 @@ hr {
   margin: 3% 0;
   box-shadow: inset var(--shadow-color) 0 0 3px;
   border-radius: 10px;
-  font-family: "JetBrains Mono",serif;
+  font-family: "JetBrains Mono", serif;
   font-size: smaller;
 }
 

+ 1 - 2
report-viewer/src/main.ts

@@ -1,4 +1,4 @@
-import { createApp } from "vue";
+import {createApp} from "vue";
 import App from "./App.vue";
 import router from "./router";
 import store from "./store/store"
@@ -7,5 +7,4 @@ import 'gitart-vue-dialog/dist/style.css'
 import 'highlight.js/lib/common';
 
 
-
 createApp(App).use(router).use(store).mount("#app");

+ 23 - 19
report-viewer/src/model/Comparison.ts

@@ -9,13 +9,6 @@ export class Comparison {
     private readonly _firstSubmissionId: string
     private readonly _secondSubmissionId: string
     private readonly _match_percentage: number
-    private _filesOfFirstSubmission: Record<string, SubmissionFile>
-    private _filesOfSecondSubmission: Record<string, SubmissionFile>
-    private _colors: Array<string>
-    private _allMatches: Array<Match>
-    private _matchesInFirstSubmission: Record<string, Array<MatchInSingleFile>>
-    private _matchesInSecondSubmissions: Record<string, Array<MatchInSingleFile>>
-
 
     constructor(firstSubmissionId: string, secondSubmissionId: string, match_percentage: number) {
         this._firstSubmissionId = firstSubmissionId;
@@ -29,18 +22,7 @@ export class Comparison {
         this._matchesInSecondSubmissions = {}
     }
 
-
-    get firstSubmissionId(): string {
-        return this._firstSubmissionId;
-    }
-
-    get secondSubmissionId(): string {
-        return this._secondSubmissionId;
-    }
-
-    get match_percentage(): number {
-        return this._match_percentage;
-    }
+    private _filesOfFirstSubmission: Record<string, SubmissionFile>
 
     get filesOfFirstSubmission(): Record<string, SubmissionFile> {
         return this._filesOfFirstSubmission;
@@ -50,6 +32,8 @@ export class Comparison {
         this._filesOfFirstSubmission = value;
     }
 
+    private _filesOfSecondSubmission: Record<string, SubmissionFile>
+
     get filesOfSecondSubmission(): Record<string, SubmissionFile> {
         return this._filesOfSecondSubmission;
     }
@@ -58,6 +42,8 @@ export class Comparison {
         this._filesOfSecondSubmission = value;
     }
 
+    private _colors: Array<string>
+
     get colors(): Array<string> {
         return this._colors;
     }
@@ -66,6 +52,8 @@ export class Comparison {
         this._colors = value;
     }
 
+    private _allMatches: Array<Match>
+
     get allMatches(): Array<Match> {
         return this._allMatches;
     }
@@ -74,6 +62,8 @@ export class Comparison {
         this._allMatches = value;
     }
 
+    private _matchesInFirstSubmission: Record<string, Array<MatchInSingleFile>>
+
     get matchesInFirstSubmission(): Record<string, Array<MatchInSingleFile>> {
         return this._matchesInFirstSubmission;
     }
@@ -82,6 +72,8 @@ export class Comparison {
         this._matchesInFirstSubmission = value;
     }
 
+    private _matchesInSecondSubmissions: Record<string, Array<MatchInSingleFile>>
+
     get matchesInSecondSubmissions(): Record<string, Array<MatchInSingleFile>> {
         return this._matchesInSecondSubmissions;
     }
@@ -89,4 +81,16 @@ export class Comparison {
     set matchesInSecondSubmissions(value: Record<string, Array<MatchInSingleFile>>) {
         this._matchesInSecondSubmissions = value;
     }
+
+    get firstSubmissionId(): string {
+        return this._firstSubmissionId;
+    }
+
+    get secondSubmissionId(): string {
+        return this._secondSubmissionId;
+    }
+
+    get match_percentage(): number {
+        return this._match_percentage;
+    }
 }

+ 4 - 4
report-viewer/src/model/Metric.ts

@@ -1,8 +1,8 @@
 import {ComparisonListElement} from "./ComparisonListElement";
 
 export type Metric = {
-    metricName : string,
-    metricThreshold : number,
-    distribution : Array<number>,
-    comparisons : Array<ComparisonListElement>
+    metricName: string,
+    metricThreshold: number,
+    distribution: Array<number>,
+    comparisons: Array<ComparisonListElement>
 }

+ 1 - 1
report-viewer/src/model/Overview.ts

@@ -14,7 +14,7 @@ export class Overview {
     private readonly _clusters: Array<Cluster>
 
 
-    constructor(submissionFolderPath: Array<string>, baseCodeFolderPath: string, language: string, fileExtensions: Array<string>,matchSensitivity: number, submissionIds: Array<string>, dateOfExecution: string, durationOfExecution: number, metrics: Array<Metric>, clusters: Array<Cluster>) {
+    constructor(submissionFolderPath: Array<string>, baseCodeFolderPath: string, language: string, fileExtensions: Array<string>, matchSensitivity: number, submissionIds: Array<string>, dateOfExecution: string, durationOfExecution: number, metrics: Array<Metric>, clusters: Array<Cluster>) {
         this._submissionFolderPath = submissionFolderPath;
         this._baseCodeFolderPath = baseCodeFolderPath;
         this._language = language;

+ 12 - 12
report-viewer/src/model/factories/ComparisonFactory.ts

@@ -11,7 +11,7 @@ export class ComparisonFactory {
 
         const matches = json.matches as Array<Record<string, unknown>>
         const colors = this.generateColorsForMatches(matches.length)
-        const coloredMatches = matches.map( (match, index) => this.mapMatch(match, colors[index]) )
+        const coloredMatches = matches.map((match, index) => this.mapMatch(match, colors[index]))
 
         const matchesInFirst = this.groupMatchesByFileName(coloredMatches, 1)
         const matchesInSecond = this.groupMatchesByFileName(coloredMatches, 2)
@@ -32,10 +32,10 @@ export class ComparisonFactory {
     }
 
     private static convertToFilesByName(files: Array<Record<string, unknown>>): Record<string, SubmissionFile> {
-        return files.reduce( (acc: Record<string, SubmissionFile>, val: Record<string, unknown>) => {
-            if(!acc[val.file_name as string]) {
+        return files.reduce((acc: Record<string, SubmissionFile>, val: Record<string, unknown>) => {
+            if (!acc[val.file_name as string]) {
                 acc[val.file_name as string] = {
-                    lines : [],
+                    lines: [],
                     collapsed: false
                 }
             }
@@ -48,14 +48,14 @@ export class ComparisonFactory {
     }
 
     private static groupMatchesByFileName(matches: Array<Match>, index: number): Record<string, Array<MatchInSingleFile>> {
-        return matches.reduce( (acc: Record<string, Array<MatchInSingleFile>>, val: Match ) => {
+        return matches.reduce((acc: Record<string, Array<MatchInSingleFile>>, val: Match) => {
             const name = index === 1 ? val.firstFile as string : val.secondFile as string
-            if(!acc[name]) {
+            if (!acc[name]) {
                 acc[name] = []
             }
-            if( index === 1 ) {
+            if (index === 1) {
                 const newVal: MatchInSingleFile = {
-                    start : val.startInFirst as number,
+                    start: val.startInFirst as number,
                     end: val.endInFirst as number,
                     linked_panel: 2,
                     linked_file: val.secondFile as string,
@@ -65,7 +65,7 @@ export class ComparisonFactory {
                 acc[name].push(newVal)
             } else {
                 const newVal: MatchInSingleFile = {
-                    start : val.startInSecond as number,
+                    start: val.startInSecond as number,
                     end: val.endInSecond as number,
                     linked_panel: 1,
                     linked_file: val.firstFile as string,
@@ -78,11 +78,11 @@ export class ComparisonFactory {
         }, {})
     }
 
-    private static generateColorsForMatches( num : number ): Array<string> {
+    private static generateColorsForMatches(num: number): Array<string> {
         const colors = []
-        const hueDelta = Math.trunc(360 / (num) )
+        const hueDelta = Math.trunc(360 / (num))
 
-        for( let i = 0; i < num; i++ ) {
+        for (let i = 0; i < num; i++) {
             const hue = i * hueDelta
 
             colors.push(`hsla(${hue}, 80%, 50%, 0.3)`)

+ 11 - 11
report-viewer/src/model/factories/OverviewFactory.ts

@@ -16,29 +16,29 @@ export class OverviewFactory {
         const duration = json.execution_time as number as number
         const metrics = [] as Array<Metric>
         const clusters = [] as Array<Cluster>
-        (json.metrics as Array<unknown>).forEach( (jsonMetric) => {
+        (json.metrics as Array<unknown>).forEach((jsonMetric) => {
             const metric = jsonMetric as Record<string, unknown>
             const comparisons = [] as Array<ComparisonListElement>
 
-            (metric.topComparisons as Array<Record<string, unknown>>).forEach( jsonComparison => {
+            (metric.topComparisons as Array<Record<string, unknown>>).forEach(jsonComparison => {
                 const comparison: ComparisonListElement = {
-                    firstSubmissionId : jsonComparison.first_submission as string,
-                    secondSubmissionId : jsonComparison.second_submission as string,
-                    matchPercentage : jsonComparison.match_percentage as number
+                    firstSubmissionId: jsonComparison.first_submission as string,
+                    secondSubmissionId: jsonComparison.second_submission as string,
+                    matchPercentage: jsonComparison.match_percentage as number
                 }
                 comparisons.push(comparison)
             })
 
-            const newMetric : Metric = {
-                metricName : metric.name as string,
-                metricThreshold : metric.threshold as number,
-                distribution : metric.distribution as Array<number>,
-                comparisons : comparisons
+            const newMetric: Metric = {
+                metricName: metric.name as string,
+                metricThreshold: metric.threshold as number,
+                distribution: metric.distribution as Array<number>,
+                comparisons: comparisons
             }
             metrics.push(newMetric)
         });
 
-        if(json.clusters) {
+        if (json.clusters) {
             (json.clusters as Array<unknown>).forEach(jsonCluster => {
                 const cluster = jsonCluster as Record<string, unknown>
                 const newCluster: Cluster = {

+ 21 - 21
report-viewer/src/router/index.ts

@@ -4,30 +4,30 @@ import ComparisonView from "@/views/ComparisonView.vue"
 import FileUploadView from "@/views/FileUploadView.vue"
 
 const routes: Array<RouteRecordRaw> = [
-  {
-    path: "/",
-    name: "FileUploadView",
-    component: FileUploadView
-  },
-  {
-    path: "/overview",
-    name: "OverviewView",
-    component: Overview,
-  },
-  {
-    path: "/comparison",
-    name: "ComparisonView",
-    component: ComparisonView,
-    props: route => ({
-      id1: route.query.firstId,
-      id2: route.query.secondId
-    })
-  },
+    {
+        path: "/",
+        name: "FileUploadView",
+        component: FileUploadView
+    },
+    {
+        path: "/overview",
+        name: "OverviewView",
+        component: Overview,
+    },
+    {
+        path: "/comparison",
+        name: "ComparisonView",
+        component: ComparisonView,
+        props: route => ({
+            id1: route.query.firstId,
+            id2: route.query.secondId
+        })
+    },
 ];
 
 const router = createRouter({
-  history: createWebHistory(),
-  routes,
+    history: createWebHistory(),
+    routes,
 });
 
 export default router;

+ 9 - 9
report-viewer/src/store/store.ts

@@ -1,19 +1,19 @@
-import { createStore} from "vuex";
+import {createStore} from "vuex";
 
 /**
  * Local store. Stores the state of the application.
  */
 const store = createStore({
-    state () {
+    state() {
         return {
             /**
              * The set of ids to be hidden.
              */
-            anonymous : new Set(),
+            anonymous: new Set(),
             /**
              * Stored files if zip mode is used. Stores the files as key - file name, value - file string
              */
-            files : Object,
+            files: Object,
             /**
              * Indicates whether local mode is used.
              */
@@ -36,23 +36,23 @@ const store = createStore({
         }
     },
     mutations: {
-        addAnonymous (state: any, id) {
+        addAnonymous(state: any, id) {
             for (let i = 0; i < id.length; i++) {
                 state.anonymous.add(id[i])
             }
         },
-        removeAnonymous (state, id) {
+        removeAnonymous(state, id) {
             for (let i = 0; i < id.length; i++) {
                 state.anonymous.delete(id[i])
             }
         },
-        resetAnonymous (state) {
+        resetAnonymous(state) {
             state.anonymous = new Set()
         },
-        saveFile (state, file: Record<string, any>) {
+        saveFile(state, file: Record<string, any>) {
             state.files[file.fileName] = file.data
         },
-        setLoadingType (state, payload: Record<string, any>) {
+        setLoadingType(state, payload: Record<string, any>) {
             state.local = payload.local
             state.zip = payload.zip
             state.single = payload.single

+ 1 - 1
report-viewer/src/utils/Utils.ts

@@ -3,7 +3,7 @@ export function generateLineCodeLink(index: number, fileName: string, line: numb
 }
 
 export function getFileExtension(file: File): string {
-    if(file.name.includes(".")) {
+    if (file.name.includes(".")) {
         const split = file.name.split(".")
         return split[split.length - 1]
     }

+ 32 - 23
report-viewer/src/views/ComparisonView.vue

@@ -1,24 +1,24 @@
 <template>
   <div class="container">
-    <button id="show-button" :class="{hidden : !hideLeftPanel}" @click="togglePanel" title="Show sidebar">
-      <img src="@/assets/double_arrow_black_24dp.svg" alt="show">
+    <button id="show-button" :class="{hidden : !hideLeftPanel}" title="Show sidebar" @click="togglePanel">
+      <img alt="show" src="@/assets/double_arrow_black_24dp.svg">
     </button>
     <div id="sidebar" :class="{ hidden : hideLeftPanel }">
       <div class="title-section">
         <h1>JPlag Comparison</h1>
-        <button id="hide-button" @click="togglePanel" title="Hide sidebar">
-          <img src="@/assets/keyboard_double_arrow_left_black_24dp.svg" alt="hide"></button>
+        <button id="hide-button" title="Hide sidebar" @click="togglePanel">
+          <img alt="hide" src="@/assets/keyboard_double_arrow_left_black_24dp.svg"></button>
       </div>
-      <TextInformation label="Submission 1" :value="id1" :anonymous="store.state.anonymous.has(id1)"/>
-      <TextInformation label="Submission 2" :value="id2" :anonymous="store.state.anonymous.has(id2)"/>
-      <TextInformation label="Match %" :value="comparison.match_percentage"/>
-      <MatchTable :matches="comparison.allMatches" :id1="id1" :id2="id2" @match-selected="showMatch" />
+      <TextInformation :anonymous="store.state.anonymous.has(id1)" :value="id1" label="Submission 1"/>
+      <TextInformation :anonymous="store.state.anonymous.has(id2)" :value="id2" label="Submission 2"/>
+      <TextInformation :value="comparison.match_percentage" label="Match %"/>
+      <MatchTable :id1="id1" :id2="id2" :matches="comparison.allMatches" @match-selected="showMatch"/>
     </div>
-    <FilesContainer :matches="comparison.matchesInFirstSubmission" :files="filesOfFirst" :container-id="1"
+    <FilesContainer :container-id="1" :files="filesOfFirst" :matches="comparison.matchesInFirstSubmission"
                     files-owner="Submission 1"
                     @toggle-collapse="toggleCollapseFirst"
                     @line-selected="showMatchInSecond"/>
-    <FilesContainer :matches="comparison.matchesInSecondSubmissions" :files="filesOfSecond" :container-id="2"
+    <FilesContainer :container-id="2" :files="filesOfSecond" :matches="comparison.matchesInSecondSubmissions"
                     files-owner="Submission 2"
                     @toggle-collapse="toggleCollapseSecond"
                     @line-selected="showMatchInFirst"/>
@@ -26,7 +26,7 @@
 </template>
 
 <script>
-import { defineComponent, ref } from "vue";
+import {defineComponent, ref} from "vue";
 import {generateLineCodeLink} from "@/utils/Utils";
 import store from "@/store/store";
 import router from "@/router";
@@ -37,7 +37,7 @@ import FilesContainer from "@/components/FilesContainer";
 
 export default defineComponent({
   name: "ComparisonView",
-  components: {FilesContainer, MatchTable, TextInformation },
+  components: {FilesContainer, MatchTable, TextInformation},
   props: {
     firstId: {
       type: String,
@@ -56,7 +56,7 @@ export default defineComponent({
 
     let comparison;
     //getting the comparison file based on the used mode (zip, local, single)
-    if(store.state.local) {
+    if (store.state.local) {
       try {
         // eslint-disable-next-line @typescript-eslint/no-var-requires
         comparison = ComparisonFactory.getComparison(require(`../files/${fileName1}.json`))
@@ -68,14 +68,14 @@ export default defineComponent({
           router.back()
         }
       }
-    } else if(store.state.zip) {
-      if(store.state.files[fileName1.concat(".json")]) {
+    } else if (store.state.zip) {
+      if (store.state.files[fileName1.concat(".json")]) {
         comparison = ComparisonFactory.getComparison(JSON.parse(store.state.files[fileName1.concat(".json")]))
       } else {
         comparison = ComparisonFactory.getComparison(JSON.parse(store.state.files[fileName2.concat(".json")]))
       }
 
-    } else if(store.state.single) {
+    } else if (store.state.single) {
       comparison = ComparisonFactory.getComparison(JSON.parse(store.state.fileString))
     }
 
@@ -86,12 +86,16 @@ export default defineComponent({
      * Collapses a file in the first files container.
      * @param title
      */
-    const toggleCollapseFirst = (title) => { filesOfFirst.value[title].collapsed = !filesOfFirst.value[title].collapsed }
+    const toggleCollapseFirst = (title) => {
+      filesOfFirst.value[title].collapsed = !filesOfFirst.value[title].collapsed
+    }
     /**
      * Collapses a file in the second files container.
      * @param title
      */
-    const toggleCollapseSecond = (title) => { filesOfSecond.value[title].collapsed = !filesOfSecond.value[title].collapsed }
+    const toggleCollapseSecond = (title) => {
+      filesOfSecond.value[title].collapsed = !filesOfSecond.value[title].collapsed
+    }
     /**
      * Shows a match in the first files container
      * @param e
@@ -99,8 +103,10 @@ export default defineComponent({
      * @param file
      * @param line
      */
-    const showMatchInFirst = ( e, panel, file, line ) => {
-      if( !filesOfFirst.value[file].collapsed ) { toggleCollapseFirst(file) }
+    const showMatchInFirst = (e, panel, file, line) => {
+      if (!filesOfFirst.value[file].collapsed) {
+        toggleCollapseFirst(file)
+      }
       document.getElementById(generateLineCodeLink(panel, file, line)).scrollIntoView()
     }
     /**
@@ -110,12 +116,14 @@ export default defineComponent({
      * @param file
      * @param line
      */
-    const showMatchInSecond = ( e, panel, file, line ) => {
-      if( !filesOfSecond.value[file].collapsed ) { toggleCollapseSecond(file) }
+    const showMatchInSecond = (e, panel, file, line) => {
+      if (!filesOfSecond.value[file].collapsed) {
+        toggleCollapseSecond(file)
+      }
       document.getElementById(generateLineCodeLink(panel, file, line)).scrollIntoView()
     }
 
-    const showMatch = ( e, match ) => {
+    const showMatch = (e, match) => {
       showMatchInFirst(e, 1, match.firstFile, match.startInFirst)
       showMatchInSecond(e, 2, match.secondFile, match.startInSecond)
     }
@@ -165,6 +173,7 @@ h1 {
   display: flex;
   justify-content: space-between;
 }
+
 .title-section > h1 {
   text-align: left !important;
 }

+ 9 - 9
report-viewer/src/views/FileUploadView.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="container" @dragover.prevent @drop.prevent>
-    <img src="@/assets/logo-nobg.png" alt="JPlag"/>
+    <img alt="JPlag" src="@/assets/logo-nobg.png"/>
     <h1>JPlag Report Viewer</h1>
     <h2>Select an overview or comparison file or a zip to display.</h2>
     <div class="drop-container" @drop="uploadFile">
@@ -14,11 +14,11 @@
 </template>
 
 <script>
-import { defineComponent } from "vue";
+import {defineComponent} from "vue";
 import jszip from "jszip"
 import router from "@/router";
 import store from "@/store/store";
-import { getFileExtension } from "@/utils/Utils";
+import {getFileExtension} from "@/utils/Utils";
 
 export default defineComponent({
   name: "FileUploadView",
@@ -28,7 +28,7 @@ export default defineComponent({
     try {
       require("../files/overview.json")
       hasLocalFile = true
-    } catch(e) {
+    } catch (e) {
       console.log(e)
       hasLocalFile = false
     }
@@ -55,7 +55,7 @@ export default defineComponent({
      * @param file
      */
     const handleZipFile = (file) => {
-      jszip.loadAsync(file).then( async (zip) => {
+      jszip.loadAsync(file).then(async (zip) => {
         for (const fileName of Object.keys(zip.files)) {
           console.log(fileName)
           await zip.files[fileName].async("string").then(data => {
@@ -73,12 +73,12 @@ export default defineComponent({
      */
     const handleJsonFile = (str) => {
       let json = JSON.parse(str)
-      if(json["submission_folder_path"]) {
+      if (json["submission_folder_path"]) {
         store.commit("setLoadingType", {local: false, zip: false, single: true, fileString: str})
         navigateToOverview()
-      } else if(json["first_submission_id"] && json["second_submission_id"]) {
+      } else if (json["first_submission_id"] && json["second_submission_id"]) {
         store.commit("setLoadingType", {local: false, zip: false, single: true, fileString: str})
-        navigateToComparisonView(json["first_submission_id"], json["second_submission_id"] )
+        navigateToComparisonView(json["first_submission_id"], json["second_submission_id"])
       }
     }
     /**
@@ -93,7 +93,7 @@ export default defineComponent({
       let read = new FileReader()
       read.onload = (e) => {
         let extension = getFileExtension(files[0])
-        if(extension === "zip") {
+        if (extension === "zip") {
           handleZipFile(files[0])
         } else if (extension === "json") {
           handleJsonFile(e.target.result)

+ 28 - 24
report-viewer/src/views/OverviewView.vue

@@ -4,44 +4,48 @@
       <h1>JPlag Report</h1>
       <p class="section-title">Main Info:</p>
       <div id="basicInfo">
-        <TextInformation label="Directory path" :value="submissionPathValue" :has-additional-info="hasMoreSubmissionPaths" additional-info-title="">
+        <TextInformation :has-additional-info="hasMoreSubmissionPaths" :value="submissionPathValue"
+                         additional-info-title="" label="Directory path">
           <p v-for="path in overview.submissionFolderPath" :key="path" :title="path">{{ path }}</p>
         </TextInformation>
-        <TextInformation label="Language" :value="overview.language" :has-additional-info="true" additional-info-title="File extensions:">
+        <TextInformation :has-additional-info="true" :value="overview.language" additional-info-title="File extensions:"
+                         label="Language">
           <p v-for="info in overview.fileExtensions" :key="info">{{ info }}</p>
         </TextInformation>
         <TextInformation :value="overview.matchSensitivity" label="Match Sensitivity"/>
-        <TextInformation label="Submissions" :value="overview.submissionIds.length" :has-additional-info="true" additional-info-title="Submission IDs:">
+        <TextInformation :has-additional-info="true" :value="overview.submissionIds.length"
+                         additional-info-title="Submission IDs:"
+                         label="Submissions">
           <IDsList :ids="overview.submissionIds" @id-sent="handleId"/>
         </TextInformation>
-        <TextInformation label="Date of execution" :value="overview.dateOfExecution"/>
-        <TextInformation label="Duration (in ms)" :value="overview.durationOfExecution"/>
+        <TextInformation :value="overview.dateOfExecution" label="Date of execution"/>
+        <TextInformation :value="overview.durationOfExecution" label="Duration (in ms)"/>
       </div>
       <div id="logo-section">
-        <img id="logo" src="@/assets/logo-nobg.png" alt="JPlag">
+        <img id="logo" alt="JPlag" src="@/assets/logo-nobg.png">
       </div>
     </div>
 
-      <div class="column-container" style="width: 35%">
-        <div id="metrics">
-          <p class="section-title">Metric:</p>
-          <div id="metrics-list">
-            <MetricButton v-for="(metric, i) in overview.metrics" :key="metric.metricName"
-                          :id="metric.metricName"
-                          :metric-threshold="metric.metricThreshold"
-                          :metric-name="metric.metricName"
-                          :is-selected="selectedMetric[i]"
-                          @click="selectMetric(i)"/>
-          </div>
+    <div class="column-container" style="width: 35%">
+      <div id="metrics">
+        <p class="section-title">Metric:</p>
+        <div id="metrics-list">
+          <MetricButton v-for="(metric, i) in overview.metrics" :id="metric.metricName"
+                        :key="metric.metricName"
+                        :is-selected="selectedMetric[i]"
+                        :metric-name="metric.metricName"
+                        :metric-threshold="metric.metricThreshold"
+                        @click="selectMetric(i)"/>
         </div>
-        <p class="section-title">Distribution:</p>
-        <DistributionDiagram class="full-width" :distribution="distributions[selectedMetricIndex]"/>
       </div>
+      <p class="section-title">Distribution:</p>
+      <DistributionDiagram :distribution="distributions[selectedMetricIndex]" class="full-width"/>
+    </div>
     <div class="column-container" style="width: 35%">
-        <p class="section-title">Top Comparisons:</p>
-        <div id="comparisonsList">
-          <ComparisonsTable :top-comparisons="topComps[selectedMetricIndex]" :clusters="overview.clusters"/>
-        </div>
+      <p class="section-title">Top Comparisons:</p>
+      <div id="comparisonsList">
+        <ComparisonsTable :clusters="overview.clusters" :top-comparisons="topComps[selectedMetricIndex]"/>
+      </div>
     </div>
   </div>
 </template>
@@ -59,7 +63,7 @@ import IDsList from "@/components/IDsList";
 
 export default defineComponent({
   name: "OverviewView",
-  components: {IDsList, ComparisonsTable, DistributionDiagram, MetricButton, TextInformation },
+  components: {IDsList, ComparisonsTable, DistributionDiagram, MetricButton, TextInformation},
   setup() {
     let overview;
     //Gets the overview file based on the used mode (zip, local, single).