Skip to content

Commit

Permalink
dont display lines when no base code found
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Jul 6, 2024
1 parent 777098a commit 21b728f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions report-viewer/src/components/fileDisplaying/MatchList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@
Sections that are likely base code (thus ignored in similarity calculation). <br />
<p>
{{ store().getDisplayName(id1) }}:
{{ basecodeInFirst.map((b) => b.match.tokens).reduce((a, b) => a + b, 0) }} Tokens,
Lines: {{ store().getDisplayName(id1 ?? '') }}: Lines
{{ basecodeInFirst.map((b) => `${b.start}-${b.end}`).join(',') }}

<span v-if="basecodeInFirst.length > 0">
{{ basecodeInFirst.map((b) => b.match.tokens).reduce((a, b) => a + b, 0) }} Tokens,
Lines: {{ store().getDisplayName(id1 ?? '') }}: Lines
{{ basecodeInFirst.map((b) => `${b.start}-${b.end}`).join(',') }}
</span>
<span v-else>No Basecode in Submission</span>
</p>
<p>
{{ store().getDisplayName(id2) }}:
{{ basecodeInSecond.map((b) => b.match.tokens).reduce((a, b) => a + b, 0) }} Tokens,
Lines: {{ store().getDisplayName(id2 ?? '') }}: Lines
{{ basecodeInSecond.map((b) => `${b.start}-${b.end}`).join(',') }}
<span v-if="basecodeInSecond.length > 0">
{{ basecodeInSecond.map((b) => b.match.tokens).reduce((a, b) => a + b, 0) }} Tokens,
Lines: {{ store().getDisplayName(id2 ?? '') }}: Lines
{{ basecodeInSecond.map((b) => `${b.start}-${b.end}`).join(',') }}
</span>
<span v-else>No Basecode in Submission</span>
</p>
</div>
</template>
Expand Down

0 comments on commit 21b728f

Please sign in to comment.