-
Notifications
You must be signed in to change notification settings - Fork 2
feat(save_and_load): add import/export methods #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
…persistence create project manager plugin for import/export operations update tests for new functionality and async loading
…ns/OpenGeodeWeb-Front into feat/save_and_load
…b-Front into feat/save_and_load
plugins/project_manager.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quel est l'objectif de ce plug-in, c'est pas déjà le rôle de l'app store?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pour moi l'app_store ne fait que de la gestion d'état sans créer de fichier ni réseau. Il permet de créer un snapshot avec le save() sous forme d'objet.
Le plugin utilise les méthode de l'appStore pour transformer le snapshot en JSON et créé un Blob, enfin lance un téléchargement pour le save.
Pour moi, le plugin utilise app_store comme moteur de snapshot et ne réimplémente pas le save & load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je crois que je comprends, dans l'idée il faudrait :
exporter : compresser l'état de Project_folder_path et lui passer aussi le snapshot pour restaurer le style, etc. et ziper le tout
importer : recoit le zip, remplace le project_folder actuel et utilise aussi le snapshot qui sera utilisé par les stores dans le Front
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un plug-in de pinia, c'est globalement l'idée d'ajouter une fonctionalité à tous les stores ou certains. Là, ce que tu veux ajouter ces pas vraiment en line avec pinia et les stores mais plutôt une action spécifique de l'app store. Qui en effet est un peu plus complexe que juste l'app store, ta question est pertinente.
Peut-être qu'il faut mettre la logique de ton plug-in dans un composable qui utiliserait l'app store et le geode store ? @JulienChampagnol qu'en penses tu ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je vais voir pour porter project_manager en tant que composable et non en tant que plugin Pinia et en même temps utiliser le store geode.js
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JulienChampagnol que penses tu de cette proposition ?
…ns/OpenGeodeWeb-Front into feat/save_and_load
…b-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
1
| .slice(1) |
reported by reviewdog 🐶
2
| JSON.stringify(snapshot.treeview, null, 2), |
reported by reviewdog 🐶
2
| JSON.stringify(snapshot.dataStyle, null, 2), |
reported by reviewdog 🐶
2
| JSON.stringify(stores.treeview.items, null, 2), |
reported by reviewdog 🐶
2
| JSON.stringify(stores.dataStyle.styles, null, 2), |
reported by reviewdog 🐶
1
| expect(stores.treeview.items.length).toBe(1) |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { useDataStyleStore } from "@/stores/data_style.js" |
reported by reviewdog 🐶
File has too many dependencies (13). Maximum allowed is 10.
| import { useDataStyleStore } from "@/stores/data_style.js" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("app.importStores restores stores", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(() => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("Project import", () => { |
reported by reviewdog 🐶
Suggest using toHaveLength().
| expect(stores.treeview.items.length).toBe(1) |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(() => { |
reported by reviewdog 🐶
async is not allowed
| test("app.importStores restores stores", async () => { |
reported by reviewdog 🐶
Expected catch or return
| default: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Expected catch or return
| viewer_call: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| default: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Prefer await to then()/catch()/finally()
| viewer_call: vi.fn(() => Promise.resolve({})), |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use Array#forEach
| .forEach((store) => stores.app.registerStore(store)) |
reported by reviewdog 🐶
Do not use null literals
| selectedTree: null, |
reported by reviewdog 🐶
Do not use null literals
| JSON.stringify(snapshot.treeview, null, 2), |
reported by reviewdog 🐶
Do not use null literals
| JSON.stringify(snapshot.dataStyle, null, 2), |
reported by reviewdog 🐶
Do not use null literals
| JSON.stringify(stores.treeview.items, null, 2), |
reported by reviewdog 🐶
Do not use null literals
| JSON.stringify(stores.dataStyle.styles, null, 2), |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unexpected empty function
| .mockImplementation(() => {}) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
0
| if (!block_ids || block_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/treeview.js
Line 95 in 769c481
| if (ids.includes(child.id)) rebuilt.push(child) |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 61 in 769c481
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 90 in 769c481
| function finalizeImportSelection() { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/treeview.js
Line 69 in 769c481
| selectionIds: selection.value.map((c) => c.id), |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/treeview.js
Line 85 in 769c481
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
300
OpenGeodeWeb-Front/stores/treeview.js
Line 77 in 769c481
| panelWidth.value = snapshot?.panelWidth || 300 |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 76 in 769c481
| snapshot?.isAdditionnalTreeDisplayed || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 77 in 769c481
| panelWidth.value = snapshot?.panelWidth || 300 |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 78 in 769c481
| model_id.value = snapshot?.model_id || "" |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 79 in 769c481
| isTreeCollection.value = snapshot?.isTreeCollection || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 769c481
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 84 in 769c481
| snapshot?.selectionIds || |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 85 in 769c481
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 769c481
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 769c481
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 121 in 769c481
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in 769c481
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 148 in 769c481
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in 769c481
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 83 in 769c481
| console.log("[DataBase] addItem -> treeview.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 85 in 769c481
| console.log("[DataBase] addItem -> hybridViewer.addItem start", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 87 in 769c481
| console.log("[DataBase] addItem -> hybridViewer.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 142 in 769c481
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 769c481
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in 769c481
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 144 in 769c481
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 146 in 769c481
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 62 in 769c481
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 74 in 769c481
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in 769c481
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 51 in 769c481
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in 769c481
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 68 in 769c481
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 76 in 769c481
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 78 in 769c481
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in 769c481
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 74 in 769c481
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in 769c481
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { defineStore } from "pinia" |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 68 in 769c481
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 60 in 769c481
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 72 in 769c481
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in 769c481
| null, |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 52 in 769c481
| return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null) |
reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.
| describe("Export", () => { |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
1
| expect(app_store.stores[1].$id).toBe("geodeStore") |
reported by reviewdog 🐶
1
| expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_2.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(userStore.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(geodeStore.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_1.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("export stores with exportStores method", () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("skip stores without exportSave method", () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("skip stores without importStores method", () => { |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("Export", () => { |
reported by reviewdog 🐶
Enforce lowercase test names
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 769c481
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 769c481
| if (!store.importStores) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 18 in 769c481
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 39 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/app.js
Line 56 in 769c481
| await store.importStores(snapshot[storeId]) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 29 in 769c481
| console.error(`[AppStore] Error exporting store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 32 in 769c481
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 41 in 769c481
| console.warn("[AppStore] import called with invalid snapshot") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 44 in 769c481
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 59 in 769c481
| console.error(`[AppStore] Error importing store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 67 in 769c481
| console.log(`[AppStore] Imported ${importedCount} stores`) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 769c481
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 769c481
| if (!store.importStores) continue |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in 769c481
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in 769c481
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
0
| if (!corner_ids || corner_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 769c481
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in 769c481
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 769c481
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 769c481
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 769c481
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in 769c481
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in 769c481
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in 769c481
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 769c481
| if (z_scale != null) { |
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | ||
| import fileDownload from "js-file-download" | ||
|
|
||
| export function useProjectManager() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| const geode = useGeodeStore() | ||
| const appStore = useAppStore() | ||
|
|
||
| async function exportProject() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| } | ||
| } | ||
|
|
||
| async function importProjectFile(file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| await api_fetch( | ||
| { schema, params: { snapshot, filename: defaultName } }, | ||
| { | ||
| response_function: async (response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Async function has no 'await' expression.
| @@ -0,0 +1,88 @@ | |||
| import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" | |||
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | |||
| import fileDownload from "js-file-download" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| ) | ||
| }) | ||
|
|
||
| describe("Project import", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
The function has too many lines (67). Maximum allowed is 50.
| }) | ||
|
|
||
| describe("Project import", () => { | ||
| test("app.importStores restores stores", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
The async function has too many lines (65). Maximum allowed is 50.
| hybridViewer: { zScale: 1.5 }, | ||
| } | ||
|
|
||
| console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| } | ||
|
|
||
| console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot)) | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| "[TEST ProjectImport] treeview snapshot:", | ||
| JSON.stringify(snapshot.treeview, null, 2), | ||
| ) | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/treeview.js
Line 95 in 5658e72
| if (ids.includes(child.id)) rebuilt.push(child) |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 61 in 5658e72
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 90 in 5658e72
| function finalizeImportSelection() { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/treeview.js
Line 69 in 5658e72
| selectionIds: selection.value.map((c) => c.id), |
reported by reviewdog 🐶
Identifier name is too short (< 2).
OpenGeodeWeb-Front/stores/treeview.js
Line 85 in 5658e72
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
300
OpenGeodeWeb-Front/stores/treeview.js
Line 77 in 5658e72
| panelWidth.value = snapshot?.panelWidth || 300 |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/treeview.js
Line 73 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 76 in 5658e72
| snapshot?.isAdditionnalTreeDisplayed || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 77 in 5658e72
| panelWidth.value = snapshot?.panelWidth || 300 |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 78 in 5658e72
| model_id.value = snapshot?.model_id || "" |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 79 in 5658e72
| isTreeCollection.value = snapshot?.isTreeCollection || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 5658e72
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 84 in 5658e72
| snapshot?.selectionIds || |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 85 in 5658e72
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 5658e72
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unexpected empty function
| .mockImplementation(() => {}) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.
| describe("Export", () => { |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
Unexpected empty function
| importStores: vi.fn().mockImplementation(() => {}), |
reported by reviewdog 🐶
1
| expect(app_store.stores[1].$id).toBe("geodeStore") |
reported by reviewdog 🐶
1
| expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_2.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_1.exportStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(userStore.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(geodeStore.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
1
| expect(mock_store_1.importStores).toHaveBeenCalledTimes(1) |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("export stores with exportStores method", () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("skip stores without exportSave method", () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("skip stores without importStores method", () => { |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("Export", () => { |
reported by reviewdog 🐶
Enforce lowercase test names
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
reported by reviewdog 🐶
0
| if (!block_ids || block_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 62 in 5658e72
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 74 in 5658e72
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in 5658e72
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 51 in 5658e72
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in 5658e72
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 68 in 5658e72
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 76 in 5658e72
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 78 in 5658e72
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in 5658e72
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 74 in 5658e72
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in 5658e72
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { defineStore } from "pinia" |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 59 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 68 in 5658e72
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 60 in 5658e72
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 72 in 5658e72
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in 5658e72
| null, |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 52 in 5658e72
| return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 5658e72
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 5658e72
| if (!store.importStores) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 18 in 5658e72
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 39 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/app.js
Line 56 in 5658e72
| await store.importStores(snapshot[storeId]) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 29 in 5658e72
| console.error(`[AppStore] Error exporting store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 32 in 5658e72
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 41 in 5658e72
| console.warn("[AppStore] import called with invalid snapshot") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 44 in 5658e72
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 59 in 5658e72
| console.error(`[AppStore] Error importing store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 67 in 5658e72
| console.log(`[AppStore] Imported ${importedCount} stores`) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 5658e72
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 5658e72
| if (!store.importStores) continue |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in 5658e72
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in 5658e72
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
0
| if (!corner_ids || corner_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 5658e72
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 121 in 5658e72
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in 5658e72
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 148 in 5658e72
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in 5658e72
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 83 in 5658e72
| console.log("[DataBase] addItem -> treeview.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 85 in 5658e72
| console.log("[DataBase] addItem -> hybridViewer.addItem start", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 87 in 5658e72
| console.log("[DataBase] addItem -> hybridViewer.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 142 in 5658e72
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 5658e72
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in 5658e72
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 144 in 5658e72
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 146 in 5658e72
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 5658e72
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in 5658e72
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 5658e72
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 5658e72
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 5658e72
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in 5658e72
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in 5658e72
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in 5658e72
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 5658e72
| if (z_scale != null) { |
|
|
||
| await stores.app.importStores(snapshot) | ||
|
|
||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| "[TEST ProjectImport] Treeview items after import:", | ||
| JSON.stringify(stores.treeview.items, null, 2), | ||
| ) | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| hybrid: useHybridViewerStore(), | ||
| } | ||
| Object.values(stores) | ||
| .slice(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
1
| console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot)) | ||
| console.log( | ||
| "[TEST ProjectImport] treeview snapshot:", | ||
| JSON.stringify(snapshot.treeview, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
2
| ) | ||
| console.log( | ||
| "[TEST ProjectImport] dataStyle snapshot:", | ||
| JSON.stringify(snapshot.dataStyle, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
2
| panelWidth: 320, | ||
| model_id: "", | ||
| isTreeCollection: false, | ||
| selectedTree: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| console.log("[TEST ProjectImport] Snapshot keys:", Object.keys(snapshot)) | ||
| console.log( | ||
| "[TEST ProjectImport] treeview snapshot:", | ||
| JSON.stringify(snapshot.treeview, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| ) | ||
| console.log( | ||
| "[TEST ProjectImport] dataStyle snapshot:", | ||
| JSON.stringify(snapshot.dataStyle, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
|
|
||
| console.log( | ||
| "[TEST ProjectImport] Treeview items after import:", | ||
| JSON.stringify(stores.treeview.items, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
| ) | ||
| console.log( | ||
| "[TEST ProjectImport] Styles after import:", | ||
| JSON.stringify(stores.dataStyle.styles, null, 2), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Do not use null literals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 76 in 9eda52e
| snapshot?.isAdditionnalTreeDisplayed || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 77 in 9eda52e
| panelWidth.value = snapshot?.panelWidth || 300 |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 78 in 9eda52e
| model_id.value = snapshot?.model_id || "" |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 79 in 9eda52e
| isTreeCollection.value = snapshot?.isTreeCollection || false |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 9eda52e
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 84 in 9eda52e
| snapshot?.selectionIds || |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 85 in 9eda52e
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in 9eda52e
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
Unnecessary 'else' after 'return'.
| return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility) |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 57 in 9eda52e
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in 9eda52e
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in 9eda52e
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in 9eda52e
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 50 in 9eda52e
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 9eda52e
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 71 in 9eda52e
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 73 in 9eda52e
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in 9eda52e
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in 9eda52e
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in 9eda52e
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { defineStore } from "pinia" |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 9eda52e
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in 9eda52e
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in 9eda52e
| const objectType = meta?.object_type |
reported by reviewdog 🐶
0
| if (!block_ids || block_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unexpected empty function
| .mockImplementation(() => {}) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
0
| if (!corner_ids || corner_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 9eda52e
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 9eda52e
| if (!store.importStores) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 18 in 9eda52e
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 39 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/app.js
Line 56 in 9eda52e
| await store.importStores(snapshot[storeId]) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 29 in 9eda52e
| console.error(`[AppStore] Error exporting store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 32 in 9eda52e
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 41 in 9eda52e
| console.warn("[AppStore] import called with invalid snapshot") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 44 in 9eda52e
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 59 in 9eda52e
| console.error(`[AppStore] Error importing store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 67 in 9eda52e
| console.log(`[AppStore] Imported ${importedCount} stores`) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 23 in 9eda52e
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 49 in 9eda52e
| if (!store.importStores) continue |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in 9eda52e
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in 9eda52e
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 9eda52e
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in 9eda52e
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 9eda52e
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 9eda52e
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in 9eda52e
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in 9eda52e
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in 9eda52e
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 9eda52e
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 9eda52e
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 121 in 9eda52e
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in 9eda52e
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 148 in 9eda52e
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in 9eda52e
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 83 in 9eda52e
| console.log("[DataBase] addItem -> treeview.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 85 in 9eda52e
| console.log("[DataBase] addItem -> hybridViewer.addItem start", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 87 in 9eda52e
| console.log("[DataBase] addItem -> hybridViewer.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 142 in 9eda52e
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in 9eda52e
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in 9eda52e
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in 9eda52e
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 144 in 9eda52e
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 146 in 9eda52e
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
|
|
||
| describe("save", () => { | ||
| test("save stores with save method", () => { | ||
| describe("Export", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
The function has too many lines (62). Maximum allowed is 50.
| email: "[email protected]", | ||
| })), | ||
| load: vi.fn().mockImplementation(() => {}), | ||
| importStores: vi.fn().mockImplementation(() => {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected empty function
| exportStores: vi | ||
| .fn() | ||
| .mockImplementation(() => ({ items: [], total: 0 })), | ||
| importStores: vi.fn().mockImplementation(() => {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected empty function
| save: vi.fn().mockImplementation(() => ({ data: "test" })), | ||
| load: vi.fn().mockImplementation(() => {}), | ||
| exportStores: vi.fn().mockImplementation(() => ({ data: "test" })), | ||
| importStores: vi.fn().mockImplementation(() => {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected empty function
| const mock_store_2 = { | ||
| $id: "withoutSave", | ||
| load: vi.fn().mockImplementation(() => {}), | ||
| importStores: vi.fn().mockImplementation(() => {}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected empty function
| test("load stores with load method", () => { | ||
| const app_store = useAppStore() | ||
| const mock_store_1 = { | ||
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce test and it usage conventions
| }) | ||
|
|
||
| test("skip stores without load method", () => { | ||
| test("skip stores without importStores method", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce test and it usage conventions
|
|
||
| describe("save", () => { | ||
| test("save stores with save method", () => { | ||
| describe("Export", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce lowercase test names
| test("load stores with load method", () => { | ||
| const app_store = useAppStore() | ||
| const mock_store_1 = { | ||
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce lowercase test names
| test("load stores with load method", () => { | ||
| const app_store = useAppStore() | ||
| const mock_store_1 = { | ||
| test("App Store > actions > importStores > import stores with importStores method", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
async is not allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/treeview.js
Line 80 in b686f44
| (snapshot?.selection || []).map((c) => c.id) || |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/treeview.js
Line 76 in b686f44
| selectedTree.value = snapshot?.selectedTree || null |
reported by reviewdog 🐶
Unnecessary 'else' after 'return'.
| return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility) |
reported by reviewdog 🐶
Unexpected console statement.
| console.log( |
reported by reviewdog 🐶
0
| if (!block_ids || block_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unexpected empty function
| .mockImplementation(() => {}) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
0
| if (!corner_ids || corner_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in b686f44
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in b686f44
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in b686f44
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in b686f44
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in b686f44
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in b686f44
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in b686f44
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in b686f44
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 23 in b686f44
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/app.js
Line 49 in b686f44
| if (!store.importStores) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 18 in b686f44
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/app.js
Line 39 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/app.js
Line 56 in b686f44
| await store.importStores(snapshot[storeId]) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 29 in b686f44
| console.error(`[AppStore] Error exporting store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 32 in b686f44
| console.log( |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 41 in b686f44
| console.warn("[AppStore] import called with invalid snapshot") |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 44 in b686f44
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 59 in b686f44
| console.error(`[AppStore] Error importing store "${storeId}":`, error) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/app.js
Line 67 in b686f44
| console.log(`[AppStore] Imported ${importedCount} stores`) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 23 in b686f44
| if (!store.exportStores) continue |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/app.js
Line 49 in b686f44
| if (!store.importStores) continue |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in b686f44
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in b686f44
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 57 in b686f44
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in b686f44
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in b686f44
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in b686f44
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 50 in b686f44
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in b686f44
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 71 in b686f44
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 73 in b686f44
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in b686f44
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in b686f44
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in b686f44
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { defineStore } from "pinia" |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in b686f44
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in b686f44
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in b686f44
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in b686f44
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 121 in b686f44
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 147 in b686f44
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 148 in b686f44
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in b686f44
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 83 in b686f44
| console.log("[DataBase] addItem -> treeview.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 85 in b686f44
| console.log("[DataBase] addItem -> hybridViewer.addItem start", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 87 in b686f44
| console.log("[DataBase] addItem -> hybridViewer.addItem done", id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 142 in b686f44
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 124 in b686f44
| if (!item) continue |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 139 in b686f44
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in b686f44
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 144 in b686f44
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 146 in b686f44
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
| import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" | ||
| import fileDownload from "js-file-download" | ||
|
|
||
| export function useProjectManager() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
The function useProjectManager has too many lines (87). Maximum allowed is 50.
| } | ||
| } | ||
|
|
||
| async function importProjectFile(file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
The async function importProjectFile has too many lines (56). Maximum allowed is 50.
| return { exportProject, importProjectFile } | ||
| } | ||
|
|
||
| export default useProjectManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Prefer named exports
|
|
||
| const schemaImport = back_schemas.opengeodeweb_back.import_project | ||
| const form = new FormData() | ||
| form.append("file", file, file?.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| method: "POST", | ||
| body: form, | ||
| }) | ||
| const snapshot = result?.snapshot ?? {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| async function importStores(snapshot) { | ||
| isAdditionnalTreeDisplayed.value = | ||
| snapshot?.isAdditionnalTreeDisplayed || false | ||
| panelWidth.value = snapshot?.panelWidth || 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| isAdditionnalTreeDisplayed.value = | ||
| snapshot?.isAdditionnalTreeDisplayed || false | ||
| panelWidth.value = snapshot?.panelWidth || 300 | ||
| model_id.value = snapshot?.model_id || "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| snapshot?.isAdditionnalTreeDisplayed || false | ||
| panelWidth.value = snapshot?.panelWidth || 300 | ||
| model_id.value = snapshot?.model_id || "" | ||
| isTreeCollection.value = snapshot?.isTreeCollection || false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| panelWidth.value = snapshot?.panelWidth || 300 | ||
| model_id.value = snapshot?.model_id || "" | ||
| isTreeCollection.value = snapshot?.isTreeCollection || false | ||
| selectedTree.value = snapshot?.selectedTree || null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| selectedTree.value = snapshot?.selectedTree || null | ||
|
|
||
| pendingSelectionIds.value = | ||
| snapshot?.selectionIds || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in 7812125
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in 7812125
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in 7812125
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 109 in 7812125
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 135 in 7812125
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 136 in 7812125
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in 7812125
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 130 in 7812125
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in 7812125
| if (!item) continue |
reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.
OpenGeodeWeb-Front/stores/data_base.js
Line 51 in 7812125
| const treeviewStore = useTreeviewStore() |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 120 in 7812125
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in 7812125
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 134 in 7812125
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 57 in 7812125
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in 7812125
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in 7812125
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in 7812125
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 50 in 7812125
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 7812125
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 71 in 7812125
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 73 in 7812125
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in 7812125
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in 7812125
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in 7812125
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { defineStore } from "pinia" |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in 7812125
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in 7812125
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in 7812125
| const objectType = meta?.object_type |
reported by reviewdog 🐶
0
| if (!block_ids || block_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Identifier name is too short (< 2).
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unexpected empty function
| .mockImplementation(() => {}) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 7812125
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in 7812125
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 7812125
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 7812125
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in 7812125
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in 7812125
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in 7812125
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in 7812125
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 7812125
| if (z_scale != null) { |
| for (const { filename, geode_object } of files) { | ||
| console.log({ filename }, { geode_object }) | ||
| promise_array.push(importFile(filename, geode_object)) | ||
| const id = await importFile(filename, geode_object) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| } = data._value | ||
|
|
||
| console.log("data._value", data._value) | ||
| console.log("[importFile] response", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| console.log("[importFile] response", { | ||
| id, | ||
| geode_object, | ||
| input_file: data._value?.input_file, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| visibility, | ||
| ) | ||
| } else if (component_type === "Edge") { | ||
| return modelEdgesStyleStore.setModelEdgesVisibility(id, visibility) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unnecessary 'else' after 'return'.
|
|
||
| function applyMeshStyle(id) { | ||
| const style = dataStyleStore.getStyle(id) | ||
| console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| console.warn("[AppStore] import called with invalid snapshot") | ||
| return | ||
| } | ||
| console.log("[AppStore] Import snapshot keys:", Object.keys(snapshot || {})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| importedCount++ | ||
| } catch (error) { | ||
| console.error(`[AppStore] Error loading store "${storeId}":`, error) | ||
| console.error(`[AppStore] Error importing store "${storeId}":`, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| } | ||
|
|
||
| console.log(`[AppStore] Loaded ${loadedCount} stores`) | ||
| console.log(`[AppStore] Imported ${importedCount} stores`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected console statement.
| if (!store.save) { | ||
| continue | ||
| } | ||
| if (!store.exportStores) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected use of continue statement.
| continue | ||
| } | ||
|
|
||
| if (!store.importStores) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected use of continue statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in e23b7e7
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 109 in e23b7e7
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in e23b7e7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 135 in e23b7e7
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 136 in e23b7e7
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in e23b7e7
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 130 in e23b7e7
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in e23b7e7
| if (!item) continue |
reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.
OpenGeodeWeb-Front/stores/data_base.js
Line 51 in e23b7e7
| const treeviewStore = useTreeviewStore() |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in e23b7e7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 120 in e23b7e7
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in e23b7e7
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 134 in e23b7e7
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in e23b7e7
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in e23b7e7
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in e23b7e7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in e23b7e7
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in e23b7e7
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in e23b7e7
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in e23b7e7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in e23b7e7
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in e23b7e7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in e23b7e7
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in e23b7e7
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in e23b7e7
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in e23b7e7
| if (z_scale != null) { |
| } | ||
|
|
||
| export { importFile, importWorkflow } | ||
| async function importWorkflowFromSnapshot(items) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| vtk_js, | ||
| } = item | ||
|
|
||
| await dataBaseStore.registerObject(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| } = item | ||
|
|
||
| await dataBaseStore.registerObject(id) | ||
| await dataBaseStore.addItem(id, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| vtk_js, | ||
| }) | ||
|
|
||
| await treeviewStore.addItem(geode_object, displayed_name, id, object_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| }) | ||
|
|
||
| await treeviewStore.addItem(geode_object, displayed_name, id, object_type) | ||
| await hybridViewerStore.addItem(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| } | ||
|
|
||
| const promises = [] | ||
| if (typeof style?.visibility === "boolean") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { | ||
| promises.push(setModelBlocksVisibility(id, block_ids, style.visibility)) | ||
| } | ||
| if (style?.color) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Optional chaining is not allowed.
| import useDataStyleState from "../internal_stores/data_style_state.js" | ||
| import useMeshStyle from "../internal_stores/mesh/index.js" | ||
| import useModelStyle from "../internal_stores/model/index.js" | ||
| import { defineStore } from "pinia" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| const response = { | ||
| _data: new Blob(["zipcontent"], { type: "application/zip" }), | ||
| headers: { | ||
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Identifier name is too short (< 2).
| test("exportProject triggers download", async () => { | ||
| const clickSpy = vi | ||
| .spyOn(HTMLAnchorElement.prototype, "click") | ||
| .mockImplementation(() => {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected empty function
…b-Front into feat/save_and_load
…ns/OpenGeodeWeb-Front into feat/save_and_load
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 62 in 6136cde
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 74 in 6136cde
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Unexpected nested ternary expression without parentheses.
OpenGeodeWeb-Front/stores/data_style.js
Line 28 in 6136cde
| : payloadOrId?.visible != null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 28 in 6136cde
| : payloadOrId?.visible != null |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 48 in 6136cde
| null, |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in 6136cde
| return modelStyleStore.modelMeshComponentVisibility(id, "Edge", null) |
reported by reviewdog 🐶
Unexpected empty function
| vi.spyOn(URL, "revokeObjectURL").mockImplementation(() => {}) |
reported by reviewdog 🐶
Variable 'clickSpy' is declared but never used. Unused variables should start with a '_'.
| const clickSpy = vi |
reported by reviewdog 🐶
Async function has no 'await' expression.
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
Async function has no 'await' expression.
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Imports should be sorted alphabetically.
| import { createTestingPinia } from "@pinia/testing" |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Enforce test and it usage conventions
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Test has no assertions
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
Do not use setup or teardown hooks
| beforeEach(async () => { |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(infra_store.create_connection).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(viewer_call).toHaveBeenCalled() |
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| expect(app_store.importStores).toHaveBeenCalled() |
reported by reviewdog 🐶
Enforce lowercase test names
| describe("ProjectManager composable", () => { |
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in 6136cde
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in 6136cde
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in 6136cde
| if (!item) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 109 in 6136cde
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 135 in 6136cde
| await registerObject(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_base.js
Line 136 in 6136cde
| await addItem(id, item) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 65 in 6136cde
| console.log("[DataBase] addItem start", { |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 130 in 6136cde
| console.log( |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_base.js
Line 112 in 6136cde
| if (!item) continue |
reported by reviewdog 🐶
Variable 'treeviewStore' is declared but never used. Unused variables should start with a '_'.
OpenGeodeWeb-Front/stores/data_base.js
Line 51 in 6136cde
| const treeviewStore = useTreeviewStore() |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_base.js
Line 127 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 120 in 6136cde
| binary_light_viewable: item?.vtk_js?.binary_light_viewable, |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 132 in 6136cde
| Object.keys(snapshot?.db || {}), |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_base.js
Line 134 in 6136cde
| for (const [id, item] of Object.entries(snapshot?.db || {})) { |
reported by reviewdog 🐶
0
| if (!surface_ids || surface_ids.length === 0) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (typeof style?.visibility === "boolean") { |
reported by reviewdog 🐶
Optional chaining is not allowed.
| if (style?.color) { |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 259 in 6136cde
| if (cam.focal_point) camera.setFocalPoint(...cam.focal_point) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 260 in 6136cde
| if (cam.view_up) camera.setViewUp(...cam.view_up) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 261 in 6136cde
| if (cam.position) camera.setPosition(...cam.position) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 281 in 6136cde
| if (cam.clipping_range) camera.setClippingRange(...cam.clipping_range) |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 282 in 6136cde
| if (typeof camera.modified === "function") camera.modified() |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 238 in 6136cde
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 271 in 6136cde
| } else if (cam.view_angle != null) { |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 276 in 6136cde
| if (cam.roll != null && typeof camera.setRoll === "function") { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in 6136cde
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in 6136cde
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 236 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
The async function importStores has too many lines (60). Maximum allowed is 50.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 236 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 238 in 6136cde
| if (z_scale != null) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 271 in 6136cde
| } else if (cam.view_angle != null) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 276 in 6136cde
| if (cam.roll != null && typeof camera.setRoll === "function") { |
reported by reviewdog 🐶
0
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 203 in 6136cde
| Object.keys(camera_options).length > 0 |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 6136cde
| return undefined |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 222 in 6136cde
| : undefined, |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 226 in 6136cde
| : undefined, |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 230 in 6136cde
| : undefined, |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 252 in 6136cde
| cam.parallel_projection !== undefined && |
reported by reviewdog 🐶
Unexpected use of undefined
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 267 in 6136cde
| cam.parallel_scale !== undefined && |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 236 in 6136cde
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 237 in 6136cde
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 242 in 6136cde
| const cam = snapshot?.camera_options |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 287 in 6136cde
| const schema = viewer_schemas?.opengeodeweb_viewer?.viewer?.update_camera |
reported by reviewdog 🐶
object spread property are not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 204 in 6136cde
| ? { ...camera_options } |
reported by reviewdog 🐶
Avoid creating new promises
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 248 in 6136cde
| await new Promise((resolve) => requestAnimationFrame(resolve)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in 6136cde
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in 6136cde
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 238 in 6136cde
| if (z_scale != null) { |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 271 in 6136cde
| } else if (cam.view_angle != null) { |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 276 in 6136cde
| if (cam.roll != null && typeof camera.setRoll === "function") { |
reported by reviewdog 🐶
Do not use useless undefined.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in 6136cde
| return undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
reported by reviewdog 🐶
async is not allowed
| beforeEach(async () => { |
reported by reviewdog 🐶
async is not allowed
| api_fetch: vi.fn(async (_req, options = {}) => { |
reported by reviewdog 🐶
async is not allowed
| vi.fn(async () => ({ snapshot: {} })), |
reported by reviewdog 🐶
async is not allowed
| test("exportProject triggers download", async () => { |
reported by reviewdog 🐶
async is not allowed
| test("importProjectFile loads snapshot", async () => { |
reported by reviewdog 🐶
Filename should be in snake case
| import { beforeEach, describe, expect, test, vi } from "vitest" |
reported by reviewdog 🐶
Do not use null literals
| get: (k) => (k === "new-file-name" ? "project_123.zip" : null), |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 27 in eecd8b7
| exportCount++ |
reported by reviewdog 🐶
Unary operator '++' used.
OpenGeodeWeb-Front/stores/app.js
Line 57 in eecd8b7
| importedCount++ |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/app.js
Line 39 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected { after 'for-of'.
OpenGeodeWeb-Front/stores/data_style.js
Line 57 in eecd8b7
| delete dataStyleState.styles[id] |
reported by reviewdog 🐶
Expected { after 'if' condition.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in eecd8b7
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 42 in eecd8b7
| function setModelEdgesVisibility(id, visibility) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 46 in eecd8b7
| function modelEdgesVisibility(id) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 50 in eecd8b7
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in eecd8b7
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 71 in eecd8b7
| await meshStyleStore.applyMeshStyle(id) |
reported by reviewdog 🐶
Unexpected await inside a loop.
OpenGeodeWeb-Front/stores/data_style.js
Line 73 in eecd8b7
| await modelStyleStore.applyModelStyle(id) |
reported by reviewdog 🐶
Unexpected console statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 20 in eecd8b7
| console.warn("[DataStyle] setVisibility skipped: unknown id", id) |
reported by reviewdog 🐶
Unexpected use of continue statement.
OpenGeodeWeb-Front/stores/data_style.js
Line 69 in eecd8b7
| if (!style || !objectType) continue |
reported by reviewdog 🐶
Use Object destructuring.
OpenGeodeWeb-Front/stores/data_style.js
Line 23 in eecd8b7
| const object_type = meta.object_type |
reported by reviewdog 🐶
Async function has no 'await' expression.
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 54 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/data_style.js
Line 63 in eecd8b7
| async function applyAllStylesFromState() { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 55 in eecd8b7
| const stylesSnapshot = snapshot?.styles || {} |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/data_style.js
Line 67 in eecd8b7
| const objectType = meta?.object_type |
reported by reviewdog 🐶
Expected !== and instead saw !=
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in eecd8b7
| if (z_scale != null) { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 193 in eecd8b7
| function clear() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 201 in eecd8b7
| function exportStores() { |
reported by reviewdog 🐶
Expected a function expression.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Do not use null comparisons without type-checking operators.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in eecd8b7
| if (z_scale != null) { |
reported by reviewdog 🐶
async is not allowed
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 205 in eecd8b7
| async function importStores(snapshot) { |
reported by reviewdog 🐶
Optional chaining is not allowed.
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 206 in eecd8b7
| const z_scale = snapshot?.zScale |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 196 in eecd8b7
| actors.forEach((actor) => renderer.removeActor(actor)) |
reported by reviewdog 🐶
Do not use Array#forEach
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 198 in eecd8b7
| Object.keys(db).forEach((id) => delete db[id]) |
reported by reviewdog 🐶
Do not use null literals
OpenGeodeWeb-Front/stores/hybrid_viewer.js
Line 207 in eecd8b7
| if (z_scale != null) { |
| function exportStores() { | ||
| const snapshotDb = {} | ||
| for (const [id, item] of Object.entries(db)) { | ||
| if (!item) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected { after 'if' condition.
| ) | ||
| } | ||
|
|
||
| function exportStores() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| return { db: snapshotDb } | ||
| } | ||
|
|
||
| async function importStores(snapshot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Expected a function expression.
| Object.keys(snapshot?.db || {}), | ||
| ) | ||
| for (const [id, item] of Object.entries(snapshot?.db || {})) { | ||
| await registerObject(id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| ) | ||
| for (const [id, item] of Object.entries(snapshot?.db || {})) { | ||
| await registerObject(id) | ||
| await addItem(id, item) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Unexpected await inside a loop.
| const app_store = useAppStore() | ||
| const { viewer_call } = await import("@/composables/viewer_call.js") | ||
|
|
||
| expect(infra_store.create_connection).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| const { viewer_call } = await import("@/composables/viewer_call.js") | ||
|
|
||
| expect(infra_store.create_connection).toHaveBeenCalled() | ||
| expect(viewer_call).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
|
|
||
| expect(infra_store.create_connection).toHaveBeenCalled() | ||
| expect(viewer_call).toHaveBeenCalled() | ||
| expect(app_store.importStores).toHaveBeenCalled() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Suggest using toBeCalledWith() or toHaveBeenCalledWith().
| useDataBaseStore: () => ({ items: {} }), | ||
| })) | ||
|
|
||
| describe("ProjectManager composable", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Enforce lowercase test names
| viewer_call: vi.fn(), | ||
| })) | ||
|
|
||
| beforeEach(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
Require test cases and hooks to be inside a describe block
…persistence
create project manager plugin for import/export operations update tests for new functionality and async loading