Преглед изворни кода

[192-webreport] Added missing documentation.

Evgeni пре 4 година
родитељ
комит
61cfff27e5

+ 4 - 0
report-viewer/src/components/ClusterRadarChart.vue

@@ -1,3 +1,7 @@
+<!--
+  Radar chart which displays a cluster member with their similarity to other
+  participants in the cluster.
+-->
 <template>
   <div class="wrapper">
     <select v-model="selectedMember">

+ 3 - 0
report-viewer/src/components/ClustersList.vue

@@ -1,3 +1,6 @@
+<!--
+  List containing all the clusters in which both comparison submissions participate.
+-->
 <template>
   <div class="wrapper">
     <h1>Clusters for comparison {{ comparison.firstSubmissionId }} > {{ comparison.secondSubmissionId }}</h1>

+ 3 - 0
report-viewer/src/components/CodePanel.vue

@@ -1,3 +1,6 @@
+<!--
+  Panel which displays a submission files with its line of code.
+-->
 <template>
   <div :id="panelId.toString().concat(title).concat(fileIndex.toString())" class="code-panel-container">
     <div class="file-title">

+ 3 - 0
report-viewer/src/components/ComparisonsTable.vue

@@ -1,3 +1,6 @@
+<!--
+  Table which display all of the comparisons with their participating ids and similarity percentage for the selected metric.
+-->
 <template>
   <table>
     <tr class="head-row">

+ 4 - 1
report-viewer/src/components/DistributionDiagram.vue

@@ -1,3 +1,6 @@
+<!--
+  Bar diagram, displaying the distribution for the selected metric.
+-->
 <template>
   <div class="wrapper">
     <BarChart :chartData="chartData" :options="options" class="chart"/>
@@ -34,7 +37,7 @@ export default defineComponent({
       borderColor: 'rgba(149, 168, 241, 1)',
       tickColor: '#000000'
     }
-    
+
     let chartData = ref({
       labels: labels,
       datasets: [{

+ 3 - 0
report-viewer/src/components/FilesContainer.vue

@@ -1,3 +1,6 @@
+<!--
+  Container containing CodePanels for all of the files in a submission.
+-->
 <template>
   <div class="files-container">
     <h1>Files of {{ filesOwner }}</h1>

+ 3 - 0
report-viewer/src/components/IDsList.vue

@@ -1,3 +1,6 @@
+<!--
+  List containing the ids of all submissions.
+-->
 <template>
   <div class="container">
     <div class="column-list">

+ 3 - 0
report-viewer/src/components/LineOfCode.vue

@@ -1,3 +1,6 @@
+<!--
+  Container which display a single line of code of a file.
+-->
 <template>
   <div :class="{'first-line' : isFirst, 'last-line' : isLast, 'visible' : visible}" :style="{background : color}"
        class="line-wrap">

+ 3 - 0
report-viewer/src/components/MatchTable.vue

@@ -1,3 +1,6 @@
+<!--
+  Table which contains all of the matches for a comparison with navigation links.
+-->
 <template>
   <div class="match-table-container">
     <table>

+ 4 - 0
report-viewer/src/components/MetricButton.vue

@@ -1,3 +1,7 @@
+<!--
+  Button which displays the information for a used metric and is used to select for which
+  metric the distribution and comparisons are displayed.
+-->
 <template>
   <div class="wrapper" v-bind:class="{ selected : isSelected }">
     <div class="metric">

+ 4 - 0
report-viewer/src/components/TextInformation.vue

@@ -1,3 +1,7 @@
+<!--
+  A container displaying simple text information. It may include additional information which is being displayed
+  in a drop down container.
+-->
 <template>
   <div class="wrapper">
     <div class="text-container">

+ 3 - 0
report-viewer/src/model/Match.ts

@@ -1,3 +1,6 @@
+/**
+ * Match between two files of two submissions.
+ */
 export type Match = {
     firstFile: string,
     secondFile: string,

+ 3 - 0
report-viewer/src/model/Metric.ts

@@ -1,5 +1,8 @@
 import {ComparisonListElement} from "./ComparisonListElement";
 
+/**
+ * Metric used in the Jplag Comparison
+ */
 export type Metric = {
     metricName: string,
     metricThreshold: number,

+ 3 - 0
report-viewer/src/router/index.ts

@@ -3,6 +3,9 @@ import OverviewView from "@/views/OverviewView.vue"
 import ComparisonView from "@/views/ComparisonView.vue"
 import FileUploadView from "@/views/FileUploadView.vue"
 
+/**
+ * Router containing the navigation destinations.
+ */
 const routes: Array<RouteRecordRaw> = [
     {
         path: "/",

+ 10 - 0
report-viewer/src/utils/Utils.ts

@@ -1,7 +1,17 @@
+/**
+ * Generates the link for a line of code.
+ * @param index Index of the files container where the line is.
+ * @param fileName File in which the line is contained.
+ * @param line Line number.
+ */
 export function generateLineCodeLink(index: number, fileName: string, line: number): string {
     return String(index).concat(fileName).concat(String(line))
 }
 
+/**
+ * Get the extension of a given file.
+ * @param file The file.
+ */
 export function getFileExtension(file: File): string {
     if (file.name.includes(".")) {
         const split = file.name.split(".")

+ 3 - 0
report-viewer/src/views/ComparisonView.vue

@@ -1,3 +1,6 @@
+<!--
+  A view displaying the .json file of a comparison from a JPlag report.
+-->
 <template>
   <div class="container">
     <button id="show-button" :class="{hidden : !hideLeftPanel}" title="Show sidebar" @click="togglePanel">

+ 3 - 0
report-viewer/src/views/FileUploadView.vue

@@ -1,3 +1,6 @@
+<!--
+  Starting view of the application. Presents the options for loading a JPlag report.
+-->
 <template>
   <div class="container" @dragover.prevent @drop.prevent>
     <img alt="JPlag" src="@/assets/logo-nobg.png"/>

+ 3 - 0
report-viewer/src/views/OverviewView.vue

@@ -1,3 +1,6 @@
+<!--
+  A view displaying the overview file of a JPlag report.
+-->
 <template>
   <div class="container">
     <div class="column-container" style="width: 30%">