Bernd-L/exDateMan

View on GitHub

Showing 114 of 114 total issues

Consider simplifying this complex logical expression.
Open

if (process.env.EDM_SSL === "true") {
// Use SSL
 
/**
* The private key for SSL
Severity: Major
Found in backend/src/server.ts - About 40 mins to fix

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

    thingData?: {
    /**
    * The name of the thing
    */
    name?: string;
    backend/src/app/client-events.ts on lines 366..383

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

    thingData?: {
    /**
    * The name of the thing
    */
    name: string;
    Severity: Minor
    Found in backend/src/app/client-events.ts and 1 other location - About 35 mins to fix
    frontend/src/app/services/EventSourcing/event-sourcing.service.ts on lines 364..381

    Function loadUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    async loadUser(): Promise<void> {
    try {
    this.user = ((await this.as.getCurrentUser()).user as unknown) as User; // TODO FixMe
    console.log(this.user);
     
     
    Severity: Minor
    Found in frontend/src/app/components/account/account.component.ts - About 35 mins to fix

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

    {
    icon: Icon.Inventory,
    title: this.is.inventories[this.inventoryUuid].name,
    routerLink: `/inventories`
    },
    Severity: Major
    Found in frontend/src/app/components/add-thing/add-thing.component.ts and 4 other locations - About 35 mins to fix
    frontend/src/app/components/add-stock/add-stock.component.ts on lines 59..63
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 69..73
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 57..61
    frontend/src/app/components/stocks/stocks.component.ts on lines 51..55

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

    const dialogRef: MatDialogRef<any> = this.dialog.open(
    DeleteConfirmationDialogComponent,
    {
    data: { inventory: this.inventory }
    }
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 150..155
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 125..130

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

    {
    icon: Icon.Inventory,
    title: this.is.inventories[this.inventoryUuid].name,
    routerLink: `/inventories`
    },
    Severity: Major
    Found in frontend/src/app/components/stocks/stocks.component.ts and 4 other locations - About 35 mins to fix
    frontend/src/app/components/add-stock/add-stock.component.ts on lines 59..63
    frontend/src/app/components/add-thing/add-thing.component.ts on lines 49..53
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 69..73
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 57..61

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

    async getUserByUuid(uuid: string): Promise<User> {
    return await this.http
    .get<User>(this.baseUrl + "/authentication/user/" + uuid)
    .toPromise();
    }
    Severity: Minor
    Found in frontend/src/app/services/auth/auth.service.ts and 1 other location - About 35 mins to fix
    frontend/src/app/services/auth/auth.service.ts on lines 157..161

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

    {
    icon: Icon.Inventory,
    title: this.is.inventories[this.inventoryUuid].name,
    routerLink: `/inventories`
    },
    Severity: Major
    Found in frontend/src/app/components/edit-thing/edit-thing.component.ts and 4 other locations - About 35 mins to fix
    frontend/src/app/components/add-stock/add-stock.component.ts on lines 59..63
    frontend/src/app/components/add-thing/add-thing.component.ts on lines 49..53
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 69..73
    frontend/src/app/components/stocks/stocks.component.ts on lines 51..55

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

    {
    icon: Icon.Inventory,
    title: this.is.inventories[this.inventoryUuid].name,
    routerLink: `/inventories`
    },
    Severity: Major
    Found in frontend/src/app/components/edit-stock/edit-stock.component.ts and 4 other locations - About 35 mins to fix
    frontend/src/app/components/add-stock/add-stock.component.ts on lines 59..63
    frontend/src/app/components/add-thing/add-thing.component.ts on lines 49..53
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 57..61
    frontend/src/app/components/stocks/stocks.component.ts on lines 51..55

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

    {
    icon: Icon.Inventory,
    title: this.is.inventories[this.inventoryUuid].name,
    routerLink: `/inventories`
    },
    Severity: Major
    Found in frontend/src/app/components/add-stock/add-stock.component.ts and 4 other locations - About 35 mins to fix
    frontend/src/app/components/add-thing/add-thing.component.ts on lines 49..53
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 69..73
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 57..61
    frontend/src/app/components/stocks/stocks.component.ts on lines 51..55

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

    this.routes.get(
    "/:inventoryUuid",
    this.checkForManagementEventLogs,
    (req: Request, res: Response) =>
    this.handleGetInventoryEventsRequest(req, res),
    Severity: Minor
    Found in backend/src/app/client-events.ts and 1 other location - About 35 mins to fix
    backend/src/app/client-events.ts on lines 51..56

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

    const dialogRef: MatDialogRef<any> = this.dialog.open(
    DeleteConfirmationDialogComponent,
    {
    data: { stock: this.stock }
    }
    Severity: Minor
    Found in frontend/src/app/components/edit-stock/edit-stock.component.ts and 2 other locations - About 35 mins to fix
    frontend/src/app/components/edit-inventory/edit-inventory.component.ts on lines 199..204
    frontend/src/app/components/edit-thing/edit-thing.component.ts on lines 125..130

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

    constructor(
    private is: InventoryService,
    private ts: ThingService,
    private route: ActivatedRoute,
    private router: Router,
    Severity: Minor
    Found in frontend/src/app/components/add-thing/add-thing.component.ts and 2 other locations - About 35 mins to fix
    frontend/src/app/components/categories/categories.component.ts on lines 26..32
    frontend/src/app/components/login/login.component.ts on lines 20..29

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

    this.routes.put(
    "/",
    this.checkForManagementEventLogs,
    (req: Request, res: Response) =>
    this.handleAppendInventoryEventRequest(req, res),
    Severity: Minor
    Found in backend/src/app/client-events.ts and 1 other location - About 35 mins to fix
    backend/src/app/client-events.ts on lines 43..48

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

    async resolveUser(email: string): Promise<User> {
    return await this.http
    .get<User>(this.baseUrl + "/authentication/resolve/" + email)
    .toPromise();
    }
    Severity: Minor
    Found in frontend/src/app/services/auth/auth.service.ts and 1 other location - About 35 mins to fix
    frontend/src/app/services/auth/auth.service.ts on lines 168..172

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

    constructor(
    private cs: CategoryService,
    private is: InventoryService,
    private route: ActivatedRoute,
    private router: Router,
    Severity: Minor
    Found in frontend/src/app/components/categories/categories.component.ts and 2 other locations - About 35 mins to fix
    frontend/src/app/components/add-thing/add-thing.component.ts on lines 27..35
    frontend/src/app/components/login/login.component.ts on lines 20..29

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

    const dialogRef: MatDialogRef<any> = this.dialog.open(
    DeleteConfirmationDialogComponent,
    {
    data: { thing: this.thing }
    }
    Severity: Minor
    Found in frontend/src/app/components/edit-thing/edit-thing.component.ts and 2 other locations - About 35 mins to fix
    frontend/src/app/components/edit-inventory/edit-inventory.component.ts on lines 199..204
    frontend/src/app/components/edit-stock/edit-stock.component.ts on lines 150..155

    Avoid too many return statements within this function.
    Open

    return false;
    Severity: Major
    Found in backend/src/app/authorization.ts - About 30 mins to fix

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

      categoryData?: {
      /**
      * The name of the category
      */
      name?: string;
      backend/src/app/client-events.ts on lines 342..361
      Severity
      Category
      Status
      Source
      Language