Bernd-L/exDateMan

View on GitHub

Showing 114 of 114 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export class AddCategoryComponent implements OnInit {
 
constructor() { }
 
ngOnInit() {
frontend/src/app/components/category-card/category-card.component.ts on lines 8..15
frontend/src/app/components/page-not-found/page-not-found.component.ts on lines 8..15

Similar blocks of code found in 3 locations. Consider refactoring.
Open

export class CategoryCardComponent implements OnInit {
 
constructor() { }
 
ngOnInit() {
frontend/src/app/components/add-category/add-category.component.ts on lines 8..15
frontend/src/app/components/page-not-found/page-not-found.component.ts on lines 8..15

Similar blocks of code found in 3 locations. Consider refactoring.
Open

constructor(
private is: InventoryService,
private as: AuthService,
private route: ActivatedRoute,
public dialog: MatDialog,
frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 33..43
frontend/src/app/components/register/register.component.ts on lines 20..30

Similar blocks of code found in 2 locations. Consider refactoring.
Open

for (const uuid of this.inventory.adminUuids) {
this.admins.push(await this.as.getUserByUuid(uuid));
}
frontend/src/app/components/edit-inventory/edit-inventory.component.ts on lines 140..142

Identical blocks of code found in 2 locations. Consider refactoring.
Open

async ngOnInit(): Promise<void> {
await this.testLogin();
document.addEventListener("auth", () => this.testLogin());
}
Severity: Minor
Found in frontend/src/app/components/side-nav/side-nav.component.ts and 1 other location - About 55 mins to fix
frontend/src/app/app.component.ts on lines 50..53

Similar blocks of code found in 2 locations. Consider refactoring.
Open

for (const uuid of this.inventory.writableUuids) {
this.writables.push(await this.as.getUserByUuid(uuid));
}
frontend/src/app/components/edit-inventory/edit-inventory.component.ts on lines 135..137

Identical blocks of code found in 2 locations. Consider refactoring.
Open

async ngOnInit(): Promise<void> {
await this.testLogin();
document.addEventListener("auth", () => this.testLogin());
}
Severity: Minor
Found in frontend/src/app/app.component.ts and 1 other location - About 55 mins to fix
frontend/src/app/components/side-nav/side-nav.component.ts on lines 25..28

Function updateUsersProjection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

public static updateUsersProjection(event: UserEvent) {
const index = Authentication.usersProjection.findIndex(
(user: User) => user.uuid === event.data.userUuid,
);
 
 
Severity: Minor
Found in backend/src/app/authentication.ts - About 55 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

this.thing = this.ts.things[this.inventoryUuid].find(
thing => thing.uuid === this.thingUuid
);
Severity: Minor
Found in frontend/src/app/components/edit-thing/edit-thing.component.ts and 1 other location - About 50 mins to fix
frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 97..99

Identical blocks of code found in 3 locations. Consider refactoring.
Open

constructor(
private as: AuthService,
private is: InventoryService,
private router: Router,
private route: ActivatedRoute,
Severity: Major
Found in frontend/src/app/components/register/register.component.ts and 2 other locations - About 50 mins to fix
frontend/src/app/components/account/account.component.ts on lines 25..33
frontend/src/app/components/login/login.component.ts on lines 20..29

Identical blocks of code found in 3 locations. Consider refactoring.
Open

constructor(
private as: AuthService,
private router: Router,
private route: ActivatedRoute,
private fb: FormBuilder
Severity: Major
Found in frontend/src/app/components/account/account.component.ts and 2 other locations - About 50 mins to fix
frontend/src/app/components/login/login.component.ts on lines 20..29
frontend/src/app/components/register/register.component.ts on lines 20..30

Similar blocks of code found in 2 locations. Consider refactoring.
Open

this.thing = this.ts.things[this.inventoryUuid].find(
value => value.uuid === this.thingUuid
);
Severity: Minor
Found in frontend/src/app/components/edit-thing/edit-thing.component.ts and 1 other location - About 50 mins to fix
frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 52..54

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{
path: "categories",
children: [
{ path: "", component: CategoriesComponent },
{ path: "new", component: AddCategoryComponent },
Severity: Minor
Found in frontend/src/app/app-routing.module.ts and 1 other location - About 50 mins to fix
frontend/src/app/app-routing.module.ts on lines 92..99

Similar blocks of code found in 2 locations. Consider refactoring.
Open

{
path: "stocks",
children: [
{ path: "", component: StocksComponent },
{ path: "new", component: AddStockComponent },
Severity: Minor
Found in frontend/src/app/app-routing.module.ts and 1 other location - About 50 mins to fix
frontend/src/app/app-routing.module.ts on lines 71..78

Identical blocks of code found in 3 locations. Consider refactoring.
Open

constructor(
private route: ActivatedRoute,
private as: AuthService,
private fb: FormBuilder,
private is: InventoryService,
Severity: Major
Found in frontend/src/app/components/login/login.component.ts and 2 other locations - About 50 mins to fix
frontend/src/app/components/account/account.component.ts on lines 25..33
frontend/src/app/components/register/register.component.ts on lines 20..30

Identical blocks of code found in 2 locations. Consider refactoring.
Open

createForm(): void {
this.form = this.fb.group({
name: ["", [Validators.required]]
});
}
Severity: Minor
Found in frontend/src/app/components/edit-thing/edit-thing.component.ts and 1 other location - About 45 mins to fix
frontend/src/app/components/add-thing/add-thing.component.ts on lines 37..41

Identical blocks of code found in 2 locations. Consider refactoring.
Open

createForm(): void {
this.form = this.fb.group({
name: ["", [Validators.required]]
});
}
Severity: Minor
Found in frontend/src/app/components/add-thing/add-thing.component.ts and 1 other location - About 45 mins to fix
frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 79..83

Function checkEventLegitimacy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

public checkEventLegitimacy(
event: InventoryEvent,
userUuid: string,
): boolean {
try {
Severity: Minor
Found in backend/src/app/authorization.ts - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Authorization.inventoriesProjection[event.inventoryUuid].ownerUuid ===
userUuid ||
Authorization.inventoriesProjection[
event.inventoryUuid
].adminUuids.includes(userUuid)
Severity: Minor
Found in backend/src/app/authorization.ts and 1 other location - About 40 mins to fix
backend/src/app/authorization.ts on lines 153..157

Similar blocks of code found in 2 locations. Consider refactoring.
Open

Authorization.inventoriesProjection[event.inventoryUuid].ownerUuid ===
userUuid ||
Authorization.inventoriesProjection[
event.inventoryUuid
].adminUuids.includes(userUuid) ||
Severity: Minor
Found in backend/src/app/authorization.ts and 1 other location - About 40 mins to fix
backend/src/app/authorization.ts on lines 143..147
Severity
Category
Status
Source
Language