Skip to content

Commit

Permalink
Fixing sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
softwaremagico committed Apr 26, 2024
1 parent 36a532f commit e0aaf21
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager)
[![GitHub last commit](https://img.shields.io/github/last-commit/softwaremagico/KendoTournamentManager)](https://github.com/softwaremagico/KendoTournamentManager)
[![CircleCI](https://circleci.com/gh/softwaremagico/KendoTournamentManager.svg?style=shield)](https://circleci.com/gh/softwaremagico/KendoTournamentManager)
[![Time](https://img.shields.io/badge/development-600h-blueviolet.svg)]()
[![Time](https://img.shields.io/badge/development-600.5h-blueviolet.svg)]()

[![Powered by](https://img.shields.io/badge/powered%20by%20java-orange.svg?logo=OpenJDK&logoColor=white)]()
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=kendo-tournament-backend&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=kendo-tournament-backend)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div (mouseout)="clearCoordinates($event)" (mouseover)="updateCoordinates($event)" onFocus="updateCoordinates($event);"
<div (mouseout)="clearCoordinates();" (mouseover)="updateCoordinates($event)" (focus)="clearCoordinates();"
(blur)="clearCoordinates();"
[class.disabled]="achievements?.length == 0"
class="achievement">
<img [alt]="getAchievementAlt()" [src]="getAchievementImage()" class="achievement-image">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class AchievementTileComponent implements OnInit, OnChanges {
this.calculateTooltipMargin();
}

clearCoordinates($event: MouseEvent): void {
clearCoordinates(): void {
this.mouseX = undefined;
this.mouseY = undefined;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<mat-icon>tune</mat-icon>
</button>
<mat-menu #mainMenuButton="matMenu" class="table-settings">
<span (click)="$event.stopPropagation()" (keydown)="$event.stopPropagation()" *ngFor="let column of basicTableData.columns; let i = index">
<span (click)="$event.stopPropagation()" (keydown)="$event.stopPropagation()"
*ngFor="let column of basicTableData.columns; let i = index">
<mat-checkbox (change)="toggleColumnVisibility(column)" [checked]="isColumnVisible(column)"
class="menu-setting-option"></mat-checkbox>
<span class="menu-setting-option-text">{{basicTableData.columnsTags[i] | translate}}</span>
Expand Down Expand Up @@ -33,6 +34,8 @@
(keydown)="basicTableData.selection.toggle(row); setSelectedItem(row)"
(mouseout)="row.hovered=false"
(mouseover)="row.hovered=true" *matRowDef="let row; columns: basicTableData.visibleColumns;"
(focus)="row.hovered=true"
(blur)="row.hovered=false"
[class.disabled]="disableRow(row)"
[ngClass]="{hovered: row.hovered, highlighted: basicTableData.selection.isSelected(row)}"
mat-row></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
mat-menu-item>{{score.toLowerCase() | translate}}
</button>
</mat-menu>
<div (mouseout)="clearCoordinates($event)" (mouseover)="updateCoordinates($event)" *ngIf="scoreRepresentation!==''"
onFocus="updateCoordinates($event);"
<div (mouseout)="clearCoordinates()" (mouseover)="updateCoordinates($event)" *ngIf="scoreRepresentation!==''"
(focus)="clearCoordinates();"
(blur)="clearCoordinates();"
class="point">
{{scoreRepresentation}}
<div *ngIf="this.timeRepresentation" [innerHTML]="tooltipText()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class ScoreComponent implements OnInit, OnChanges {
this.calculateTooltipMargin();
}

clearCoordinates($event: MouseEvent): void {
clearCoordinates(): void {
this.mouseX = undefined;
this.mouseY = undefined;
}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/app/components/fight/fight.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<mat-icon class="kendo-icon" svgIcon="ribbon"></mat-icon>
</div>
<div *ngIf="fight" [ngClass]="{selected: selected}" cdkDropListGroup class="fight">
<duel (click)="selectDuel(duel)" *ngFor="let duel of fight.duels; let i = index" [duelIndex]="i" [duel]="duel"
<duel *ngFor="let duel of fight.duels; let i = index" [duelIndex]="i" [duel]="duel"
(click)="selectDuel(duel)"
(keydown)="selectDuel(duel)"
[fight]="fight"
[ngClass]="{duelSelected: duel === selectedDuel && selected && (RbacActivity.SELECT_DUEL | rbac : this.rbacService.getActivities()), over: isOver(duel)}"
[selected]="duel === selectedDuel && (RbacActivity.SELECT_DUEL | rbac : this.rbacService.getActivities())"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
<mat-icon class="kendo-icon" svgIcon="ribbon"></mat-icon>
</div>
<div class="untie">
<duel (click)="selectDuel(duel)" [duel]="duel" [ngClass]="{duelSelected: selected, over: isOver(duel)}"
<duel [duel]="duel" [ngClass]="{duelSelected: selected, over: isOver(duel)}"
(click)="selectDuel(duel)"
(keydown)="selectDuel(duel)"
[selected]="selected" [swapTeams]="swapTeams"
class="duel"></duel>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h1 mat-dialog-title>{{title}}</h1>
required>
<mat-error *ngIf="registerForm.value.password">{{'invalidPasswordError' | translate}}</mat-error>
<mat-icon (click)="setHidePassword(!hidePassword)"
(keydown)="setHidePassword(!hidePassword)"
matSuffix>{{hidePassword ? 'visibility_off' : 'visibility'}}
</mat-icon>
</mat-form-field>
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/app/views/fight-list/fight-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<div class="shiaijo-label">
{{'shiaijo'| translate}}
</div>
<div class="shiaijo-name" (click)="changeShiaijo()">
<div class="shiaijo-name" (click)="changeShiaijo()" (keydown)="changeShiaijo()" >
{{getShiaijoTag()}}
</div>
</div>
Expand All @@ -169,14 +169,16 @@ <h3 *ngIf="filteredFights.get(group.id!)?.length! > 0"
class="group-name">{{'group' | translate}} {{group.index + 1}}</h3>
<div *ngIf="filteredFights.get(group.id!)?.length! > 0"
[ngClass]="{'fights-of-group': groups.length > 1 && filteredFights.get(group.id!)?.length! > 0}">
<fight (click)="selectFight(fight)" (onSelectedDuel)="selectDuel($event)"
<fight (click)="selectFight(fight)" (keydown)="selectFight(fight)" (onSelectedDuel)="selectDuel($event)"
*ngFor="let fight of filteredFights.get(group.id!)"
[fight]="fight" [over]="isFightOver(fight)" [selected]="fight === selectedFight"
[showAvatars]="showAvatars" [swapColors]="swappedColors"
[swapTeams]="swappedTeams"></fight>

<div class="unties-list">
<untie-fight (click)="selectDuel(duel)" *ngFor="let duel of filteredUnties.get(group.id!)" [duel]="duel"
<untie-fight *ngFor="let duel of filteredUnties.get(group.id!)" [duel]="duel"
(click)="selectDuel(duel)"
(keydown)="selectDuel(duel)"
[ngClass]="{duelSelected: duel === selectedDuel, over: isOver(duel)}"
[selected]="duel === selectedDuel" [swapColors]="swappedColors"
[swapTeams]="swappedTeams"></untie-fight>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="gallery">
<div *ngFor="let image of pictures; let i = index" class="image-container">
<img (click)="selectImage(i)" [class.selected-image]="i === selectedPicture" alt="Participant's Picture"
<img (click)="selectImage(i)" (keydown)="selectImage(i)" [class.selected-image]="i === selectedPicture" alt="Participant's Picture"
src="{{ image }}"/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/views/passwords/passwords.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
required>
<mat-error>{{'invalidPasswordError' | translate}}</mat-error>
<mat-icon (click)="hidePassword = !hidePassword"
(keydown)="hidePassword = !hidePassword"
matSuffix>{{hidePassword ? 'visibility_off' : 'visibility'}}
</mat-icon>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h1 mat-dialog-title>{{title}}</h1>
<mat-form-field *ngIf="actionName != 'Delete'">
<mat-label>{{'tournamentType' | translate}}</mat-label>
<mat-select [(value)]="tournament.type" formControlName="tournamentType">
<mat-option (click)="select(type)" *ngFor="let type of tournamentType" [value]="type">
<mat-option (click)="select(type)" (keydown)="select(type)" *ngFor="let type of tournamentType" [value]="type">
{{getTournamentTypeTranslationTag(type) | translate}}
</mat-option>
</mat-select>
Expand Down Expand Up @@ -42,7 +42,8 @@ <h1 mat-dialog-title>{{title}}</h1>
<mat-select [(value)]="tournament.tournamentScore.scoreType" [matTooltipShowDelay]="1000"
formControlName="scoreTypes"
matTooltip="{{tournament.tournamentScore.scoreType.toLowerCase()+'Hint' | translate}}">
<mat-option (click)="selectScore(type)" *ngFor="let type of scoreTypes" [matTooltipShowDelay]="1000"
<mat-option *ngFor="let type of scoreTypes" [matTooltipShowDelay]="1000"
(click)="selectScore(type)" (keydown)="selectScore(type)"
[value]="type" matTooltip="{{type.toLowerCase()+'Hint' | translate}}">
{{type.toLowerCase() | translate}}
</mat-option>
Expand All @@ -60,7 +61,8 @@ <h1 mat-dialog-title>{{title}}</h1>
<mat-select [(value)]="tournament.duelsDuration" formControlName="duelsDuration">
<mat-option *ngFor="let number of [30, 60, 90, 120, 150, 180, 240, 300, 360, 420, 480, 540, 600]"
[value]="number">
{{number}} {{'seconds' | translate}} ({{getMinutes(number)}} {{'minutes' | translate}} {{getSeconds(number)}} {{'seconds' | translate}})
{{number}} {{'seconds' | translate}}
({{getMinutes(number)}} {{'minutes' | translate}} {{getSeconds(number)}} {{'seconds' | translate}})
</mat-option>
</mat-select>
</mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<div class="teams">
<div *ngFor="let team of teams" class="teams-location">
<div>
<h2 (click)="setEditable(team, this.rbacService.isAllowed(RbacActivity.EDIT_TEAM))" *ngIf="!team.editing"
<h2 *ngIf="!team.editing"
(click)="setEditable(team, this.rbacService.isAllowed(RbacActivity.EDIT_TEAM))"
(keydown)="setEditable(team, this.rbacService.isAllowed(RbacActivity.EDIT_TEAM))"
class="team-header">{{team.name}}</h2>
<button (click)="deleteTeam(team)"
*ngIf="!team.editing && !team.locked && (RbacActivity.DELETE_TEAM | rbac : this.rbacService.getActivities())"
Expand Down Expand Up @@ -51,7 +53,9 @@
</div>
</div>
</div>
<div (click)="addTeam()" *ngIf="(RbacActivity.CREATE_TEAM | rbac : this.rbacService.getActivities())" class="new-team">
<div *ngIf="(RbacActivity.CREATE_TEAM | rbac : this.rbacService.getActivities())" class="new-team"
(click)="addTeam()"
(keydown)="addTeam()">
<div class="row">{{'addTeamToTournament' | translate}}</div>
</div>
</div>
Expand Down

0 comments on commit e0aaf21

Please sign in to comment.