diff --git a/0 b/0 new file mode 100644 index 0000000..f8f8d71 --- /dev/null +++ b/0 @@ -0,0 +1,706 @@ +check-refactocheck-refactored-pipeline-status.ts:97:1 suppressions/unused ━━━━━━━━━━━━━━━━━━red-pipeline-status.ts:97:1 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +━ + + ! S ! Suppressuppression coion commentmment has n has no effo effect. Rect. Removeemove the s the suppreuppression ossion or make r make sure yosure you are suppressing the correct rule. + +u are suppressing the correct rule. + + 95 │ } + 96 │ + > 97 95 │ } + 96 │ + > 97 │ // b│ // biome-iome-ignore ignore lint/compllint/complexity/exity/noExcesnoExcessiveCognitiveComplexity: Main orsiveCognitiveComplexity: Main orchestrchestrationation func function tion - comp- complexitylexity is a is appropppropriateriate for for its its scopescope + + │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 98 │ as 98 │ async fync functiounction checkRefan checkRefactoredctoredPipelineStatus() { + 99 │ tryPipelineStatus() { + 99 │ try { + + { + + +a +app/api/pp/api/adminadmin/audit/audit-logs-logs/route/route.ts.ts::12:23 12:23 lint/colint/complexity/nomplexity/noExcessiExcessiveCognitivveCognitiveCompleeComplexity xity ━━━━━━━━━━━━━━━━━━ + + × Ex━━ + + × Excessive cocessive complexitmplexity of 17y of 17 detected detected (max: 15)(max: 15). + +. + + 10 │ } 10 │ } from from "../../"../../../../li../../lib/secub/securityAuditrityAuditLogger"Logger"; + ; + 11 │ + 11 │ + > 12 │ e > 12 │ export axport async function GET(request: Nextsync function GET(request: NextRequesRequest) { +t) { + │ │ ^ ^^^ + ^^ + 13 │ 13 │ try { + try { + 14 │ 14 │ con const sessiost session = awn = await getSait getServerSeerverSession(autssion(authOptiohOptions); + +ns); + + i Please i Please refac refactor this ftor this function unction to reducto reduce its ce its complexiomplexity score fty score from 17 rom 17 to the maxto the max allowe allowed complexd complexity 15. +ity 15. + + +ap + +app/api/admip/api/admin/securn/security-monitity-monitoring/thoring/threat-anreat-analysis/ralysis/route.tsoute.ts:1:1 as:1:1 assist/source/organizeImports FIXABLsist/source/organizeImports FIXABLE E ━━━━━━━━━━━━━━━━━━ + + × T━━ + + × The imporhe imports and ts and exports arexports are not se not sorted. + + > 1 │ import orted. + + > 1 │ import { type{ type NextR NextRequestequest, NextResp, NextResponse }onse } from from "next/ser"next/server"; +ver"; + │ ^ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + 2 ^ + 2 │ impo│ import { getrt { getServerSServerSessionession } from } from "next-"next-auth"; + auth"; + 3 │ 3 │ import import { z } f{ z } from "zorom "zod"; + +d"; + + i Sa i Safe fix: Orfe fix: Organize Iganize Imports (Bmports (Biome) + iome) + + + 8 8 8 │ securityAuditLogger, + 8 │ securityAuditLogger, + 9 9 9 │ }9 │ } from from "@/lib/sec"@/lib/securityAurityAuditLoggeuditLogger"; + r"; + 10 │ - imp 10 │ - impoort·{rt·{·secur·securityMonitoityMonitoring,·ring,·type·SecurityMetrics,·type·Aletype·SecurityMetrics,·type·AlertTypertType·}·fro·}·from·"@/lib/sm·"@/lib/securiecurityMonittyMonitoring"; +oring"; + 10 │ 10 │ + impo+ import·{·typrt·{·type·Alere·AlertType,·type·SecurityMetrics,·setType,·type·SecurityMetrics,·securitycurityMonitoMonitoring·}ring·}·from·"@/l·from·"@/lib/secib/securityMonurityMonitorinitoring"; + g"; + 11 11 11 11 │ + │ + 12 12 12 │ const threatAnalysisSchema = z.o12 │ const threatAnalysisSchema = z.object(bject({ + { + + +app/ap + +app/api/admii/admin/securn/security-monitoity-monitoring/thring/threat-anareat-analysis/rlysis/route.ts foute.ts format ormat ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +━━━━━━━━━━━━━ + + × Formatter woul × Formatter would have printed the following content: + +d have printed the following content: + + 8 8 │ 8 8 │ securityAuditLogger, + 9 9 │ } fr securityAuditLogger, + 9 9 │ } from "@/om "@/lib/selib/securitcurityAudiyAuditLoggtLogger"; +er"; + 1 10 │ -0 │ - impor import·{·set·{·securityMocurityMonitornitoring,·typing,·type·Sece·SecurityMeturityMetrics,·rics,·type·Altype·AlertTypertType·}·fe·}·from·"@rom·"@/lib/s/lib/securityMoecurityMonitoringnitoring"; + "; + 10 10 │ + im│ + import·{ +port·{ + 11 │ + 11 │ + ··secu··securityMonirityMonitoringtoring, + , + 12 12 │ + ··ty│ + ··type·Secpe·SecurityMeurityMetrics, + trics, + 13 │ 13 │ + ··ty+ ··type·Alertpe·AlertType, +Type, + 14 │ + 14 │ + }·from· }·from·"@/lib"@/lib/securit/securityMonityMonitoring"; +oring"; + 11 11 15 │ 15 │ + 12 16 │ c + 12 16 │ const tonst threatAhreatAnalysisScnalysisSchema = z.hema = z.objectobject({ + ({ + + + + +app/aapp/api/csrf-tpi/csrf-token/rooken/route.ts:ute.ts:8:13 8:13 lint/corrlint/correctnessectness/noUnus/noUnusedImportedImports FIXs FIXABLABLE ━━━━━━━━━━━E ━━━━━━━━━━━━━━━━ + + × This import is unused. + + ━━━━━ + + × This import is unused. + + 6 │ 6 │ */ + */ + 7 7 │ + > 8│ + > 8 │ imp │ import tyort type { NextRequest } from "nextpe { NextRequest } from "next/serve/server"; + r"; + │ │ ^^^^^^^^^^^^^^^ + 9 │ imp ^^^^^^^^^^^^^^^ + 9 │ import {ort { genera generateCSRFToteCSRFTokenRespkenResponse onse } from "} from "../../../../../middleware/csrfProtection"../middleware/csrfProtection"; + ; + 10 │ + 10 │ + + i U + i Unused imponused imports mirts might be thght be the resule result of an it of an incomplncomplete reete refactorifactoring. + + ng. + + i Unsafei Unsafe fix: R fix: Remove themove the unusee unused impord imports. + +ts. + + 1 │ - 1 │ - /** + 2 │ - ·*·CSRF·Token·AP /** + 2 │ - ·*·CSRF·Token·API·EndpI·Endpoint + oint + 3 3 │ - ·*│ - ·* + 4 + 4 │ - ·*·This·endpoint·pro │ - ·*·This·endpoint·provides·CSvides·CSRF·tokRF·tokens·toens·to·clients·clients·for·s·for·secure·ecure·form·submissions. + 5 │form·submissions. + 5 │ - ·*· - ·*·It·genIt·generates·a·erates·a·new·tokennew·token·and·set·and·sets·it·as·it·as·an·HTs·an·HTTP-only·TP-only·cookiecookie. + . + 6 │ - 6 │ - ·*/ + ·*/ + 7 7 │ - + │ - + 8 8 │ - │ - import·import·type·{·Ntype·{·NextReqextRequest·}·uest·}·from·"nexfrom·"next/servt/server"; + er"; + 1 1 │ + /* │ + /** + * + 2 │ + 2 │ + ·*·C ·*·CSRF·ToSRF·Token·API·ken·API·EndpoiEndpoint + nt + 3 │ 3 │ + ·* + + ·* + 4 4 │ + ·*· │ + ·*·This·eThis·endpoint·ndpoint·providprovides·CSRFes·CSRF·token·tokens·to·cls·to·clients·ients·for·secufor·secure·forre·form·submim·submissionsssions. + . + 5 │ 5 │ + ·*·It·+ ·*·It·generagenerates·a·tes·a·new·toknew·token·anden·and·sets·it·sets·it·as·a·as·an·HTTP-on·HTTP-only·cooknly·cookie. + ie. + 6 6 │ + ·*/ │ + ·*/ + + 7 │ + 7 │ + + + 9 8 │ 9 8 │ impo import { gert { generatenerateCSRFTokeCSRFTokenResponResponse } from "../../../middleware/csrfProtecnse } from "../../../middleware/csrfProtection"; + tion"; + 10 10 9 │ + 9 │ + + +app/ + +app/api/dashbapi/dashboard/moard/metrics/roetrics/route.tsute.ts::109:63109:63 lint/co lint/complexitmplexity/noExcesy/noExcessiveCogsiveCognitiveConitiveComplexity mplexity ━━━━━━━━━━━━━━━━━━━━ + + × + + × Excessi Excessive compve complexity oflexity of 18 det 18 detected (maected (max: 15).x: 15). + + + + 108 │ 108 │ // Con // Convert Pvert Prisma serisma sessionsssions to Chat to ChatSessioSession[] typen[] type for s for sessionMeessionMetrics +trics + > 109 > 109 │ co│ const chatnst chatSessioSessions: Chans: ChatSessiotSession[] = prn[] = prismaSeismaSessions.ssions.map((ps)map((ps) => { + => { + │ │ ^^^ + ^^^ + 110 │ 110 │ / // Get qu/ Get questionestions for ts for this sehis session ossion or empty r empty array +array + 111 111 │ │ const qconst questionuestions = ques = questionsBystionsBySessioSession[ps.idn[ps.id] || [] || []; + +]; + + i Pl i Please refease refactor tactor this functhis function to ion to reduce ireduce its complets complexity sxity score frcore from 18 tom 18 to the maxo the max allowe allowed compled complexity 15xity 15. + + +a. + + +app/apipp/api/dashb/dashboard/seoard/session-fssion-filter-opilter-options/rtions/route.toute.ts:1:s:1:10 lin10 lint/correctt/correctness/nness/noUnusedImoUnusedImports ports FIXABLE FIXABLE ━━━ ━━━━━━━━━━━━━━━━━ + + × + + × SeveraSeveral of thesl of these impoe imports are rts are unused.unused. + + + + > 1 │ i > 1 │ import mport { type { type NextReNextRequest, Nquest, NextResextResponse } ponse } from "nfrom "next/seext/server"; + rver"; + │ │ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ + ^^^^ + 2 │ imp 2 │ import { ort { getServegetServerSessirSession } froon } from "nextm "next-auth/n-auth/next"; + ext"; + 3 │ 3 │ import import { auth{ authOptions Options } fro} from "../.m "../../../.././../../lib/aulib/auth"; +th"; + + i + i Unused imUnused imports miports might be tght be the reshe result of an inult of an incomplete refactoring. + + i Unsafe fix: Remocomplete refactoring. + + i Unsafe fix: Remove the ve the unusedunused imports imports. + +. + + 1 │ 1 │ import·{·type·NextRequest,·NextResimport·{·type·NextRequest,·NextResponse·ponse·}·from}·from·"next/s·"next/server"; +erver"; + │ │ -------------------------------- ---- + +app/api/dashboard/session/[id]/ + +app/api/dashboard/session/[id]/route.troute.tss:5:23:5:23 lint/ lint/complexitycomplexity/noExc/noExcessiveCogessiveCognitivenitiveComplexity ━━━━━━━━━━ + + × EComplexity ━━━━━━━━━━ + + × Excessivxcessive comple complexity exity of 19 deteof 19 detected (cted (max: 15).max: 15). + + + + 3 │ impo 3 │ import tyrt type { Chape { ChatSesstSession } ion } from ".from "../../../../../../.././../../lib/typelib/types"; + s"; + 4 │ + 4 │ + > 5 │ > 5 │ export export async async functionfunction GET( + GET( + │ │ ^ ^^^ + ^^ + 6 │ 6 │ _request_request: Next: NextRequestRequest, + , + 7 │ { 7 │ { params params }: { p}: { params: arams: Promise } +g }> } + + i Please refactor this function to reduce its complexity score from 19 + i Please refactor this function to reduce its complexity score from 19 to the max to the max allowedallowed complexi complexity 15. + + +app/dashboard/audit-logs/paty 15. + + +app/dashboard/audit-logs/page.tsxge.tsx:3:1 as:3:1 assist/source/organizeImports FIXABLE sist/source/organizeImports FIXABLE ━━━━━━━━━━━━━━━━━━━━ + + × The imports and exports a━━━━━━━━ + + × The imports and exports are not sorre not sorted. + ted. + + + 1 │ 1 │ "use client"; + 2 │ + > 3 │ impo"use client"; + 2 │ + > 3 │ import { frt { formatDormatDistanistanceToNow } fceToNow } from "drom "date-fate-fns"; + ns"; + │ │ ^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^ + 4 4 │ impo│ import { usrt { useSessieSession } fron } from "neom "next-auth/xt-auth/react";react"; + 5 │ + 5 │ imporimport { useEt { useEffect,ffect, useSta useState, usete, useCallbackCallback } fro } from "react";m "react"; + + i + + i Safe f Safe fix: Organizeix: Organize Impor Imports (Biomets (Biome) + +) + + 3 3 │ import { formatDistanceT3 3 │ import { formatDistanceToNow } oNow } from "from "date-fns"date-fns"; + 4; + 4 4 │ 4 │ impor import { useSt { useSessioession } fron } from "nexm "next-auth/t-auth/react";react"; + 5 + 5 │ - │ - impo import·{·urt·{·useEffecseEffect,·useState,·useCallback·}·ft,·useState,·useCallback·}·from·"react"; + 5 │ + improm·"react"; + 5 │ + import·{·ort·{·useCaluseCallback,lback,·useEffe·useEffect,·usct,·useState·eState·}·from}·from·"react";·"react"; + + 6 6 │ 6 6 │ imp import { Alort { Alert, ert, AlertDeAlertDescriptioscription } fn } from "..rom "../../..//../../componencomponents/uits/ui/alert"/alert"; + ; + 7 7 7 7 │ imp│ import { Bort { Badge } fadge } from "../rom "../../../../../componecomponents/ui/bnts/ui/badge"; +adge"; + + + + +app/app/dashboardashboard/audit-d/audit-logs/pagelogs/page.tsx.tsx:222:15:222:15 lint/a11y/noLab lint/a11y/noLabelWitelWithoutConhoutControl trol ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +━━━━━━━ + + × A + × A form laform label mustbel must be assoc be associated wiated with an inith an input. + +put. + + 22 220 │
+ 4"> + 221 221 │ │
+
+ > 22 > 222 │ 2 │ < dium">Event TyEvent Type + abel> + │ │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ^^^^ + 223 │ 223 │ + > 244 │ │
+ > 244 │