snippet_slug
stringlengths
97
241
task_slug
stringlengths
81
225
domain
stringclasses
40 values
context
stringclasses
13 values
description
stringlengths
82
228
lang
stringclasses
4 values
code
stringlengths
110
4.47k
line_count
int64
5
80
unclear_naming
bool
2 classes
noise_comments
bool
2 classes
dead_code
bool
2 classes
inconsistent_style
bool
2 classes
over_abstracted
bool
2 classes
too_clever
bool
2 classes
duplicated_logic
bool
2 classes
error_handling_problem
bool
2 classes
type_safety_hole
bool
2 classes
unsafe_input
bool
2 classes
primary_flaw
stringclasses
11 values
quality
int64
1
5
difficulty
stringclasses
3 values
uncertain_flags
listlengths
0
3
findings
listlengths
0
28
format-a-numerical-minor-unit-integer-into-a-localized-currency-string-using-the-specified-iso-currency-code-js-f708870b8252
format-a-numerical-minor-unit-integer-into-a-localized-currency-string-using-the-specified-iso-currency-code
payments
utility
Format a numerical minor-unit integer into a localized currency string using the specified ISO currency code.
js
class CurrencyRenderer { constructor(currency, locale) { this.formatter = new Intl.NumberFormat(locale, { style: 'currency', currency }) } render(minorUnits) { const fractionDigits = this.formatter.resolvedOptions().maximumFractionDigits return this.formatter.format(minorUnits / 10 ** fractionDigits)...
31
false
false
false
false
true
false
false
false
false
false
over_abstracted
3
subtle
[]
[ { "finding_slug": "over-abstracted-f708870b8252-l12-l14-a8e96955", "flag": "over_abstracted", "start_line": 12, "end_line": 14, "excerpt": "function createCurrencyRenderer(currency, locale) {", "explanation": "This single-case factory only forwards its arguments to the CurrencyRenderer const...
sanitize-user-biography-input-strings-by-stripping-unauthorized-html-tags-and-encoding-special-symbols-ts-b1c6cffc435c
sanitize-user-biography-input-strings-by-stripping-unauthorized-html-tags-and-encoding-special-symbols
user-profiles
utility
Sanitize user biography input strings by stripping unauthorized HTML tags and encoding special symbols.
ts
const re = /<!--[\s\S]*?(?:-->|$)|<\/?[a-z][^<>]*>/gi const tbl = new Map<string, string>([ ['&', '&amp;'], ['<', '&lt;'], ['>', '&gt;'], ['"', '&quot;'], ["'", '&#39;'] ]) export default function sanitizeBiography(input: unknown): string { if (typeof input !== 'string') { throw new Ty...
28
true
false
false
false
false
false
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-b1c6cffc435c-l1-l1-c75907e9", "flag": "unclear_naming", "start_line": 1, "end_line": 1, "excerpt": "const re = /<!--[\\s\\S]*?(?:-->|$)|<\\/?[a-z][^<>]*>/gi", "explanation": "The name identifies only a regular expression, not that it matches biography markup...
define-typescript-interfaces-representing-patient-medical-history-records-and-recurring-treatment-prescriptions-ts-679f97c183ef
define-typescript-interfaces-representing-patient-medical-history-records-and-recurring-treatment-prescriptions
clinic-appointments
type-definitions
Define TypeScript interfaces representing patient medical history records and recurring treatment prescriptions.
ts
type K = 'id' | 'patientId' | 'recordedAt' | 'condition' | 'notes' | 'treatment' | 'dose' | 'startsOn' | 'endsOn' | 'intervalDays'; type O = 'notes' | 'endsOn'; type V<P extends K> = P extends 'intervalDays' ? number : P extends 'endsOn' ? string | null : string; type S<P extends K> = { [Q in Exclude<P, O>]: V<Q>; ...
39
true
false
false
false
false
true
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-679f97c183ef-l1-l2-5834b26a", "flag": "unclear_naming", "start_line": 1, "end_line": 2, "excerpt": "type K = 'id' | 'patientId' | 'recordedAt' | 'condition' | 'notes'", "explanation": "K does not identify this union as the available medical-history and presc...
build-a-redux-slice-reducer-that-stores-active-audit-log-filters-including-date-ranges-user-identifiers-and-severity-levels-ts-e4456f0c703a
build-a-redux-slice-reducer-that-stores-active-audit-log-filters-including-date-ranges-user-identifiers-and-severity-levels
audit-logging
state-management
Build a Redux slice reducer that stores active audit log filters including date ranges, user identifiers, and severity levels.
ts
import { createSlice, type PayloadAction } from "@reduxjs/toolkit"; import { z } from "zod"; const filterSchema = z.object({ from: z.number().finite().nullable(), to: z.number().finite().nullable(), userIds: z.array(z.string().trim().min(1)), severities: z.array(z.enum(["info", "warning", "error", "cri...
34
false
false
false
false
false
false
false
true
false
false
error_handling_problem
3
subtle
[]
[ { "finding_slug": "error-handling-problem-e4456f0c703a-l24-l26-20a99d83", "flag": "error_handling_problem", "start_line": 24, "end_line": 26, "excerpt": " } catch {", "explanation": "The catch silently discards schema-validation failures and returns normally, leaving the existing ...
define-typescript-interfaces-for-vendor-catalog-items-tax-rates-and-tiered-volume-discount-structures-ts-51aafec7c6d4
define-typescript-interfaces-for-vendor-catalog-items-tax-rates-and-tiered-volume-discount-structures
procurement
type-definitions
Define TypeScript interfaces for vendor catalog items, tax rates, and tiered volume discount structures.
ts
export type CurrencyCode = "USD" | "EUR" | "GBP" | "CAD"; export interface VolumeTier { readonly minimumQuantity: number; readonly maximumQuantity: number | null; readonly unitPrice: number; } export interface TaxRateDefinition { readonly taxCode: string; readonly jurisdiction: string; readonly percentageRa...
37
false
false
true
false
false
false
false
false
true
false
type_safety_hole
2
subtle
[]
[ { "finding_slug": "dead-code-51aafec7c6d4-l25-l25-962c5c05", "flag": "dead_code", "start_line": 25, "end_line": 25, "excerpt": " const extendedBasePrice = item.basePrice * quantity;", "explanation": "extendedBasePrice is never read, so this unused total-price calculation should be removed."...
assert-that-the-sla-calculation-utility-correctly-identifies-breached-support-tickets-when-response-times-exceed-the-twenty-four-hour-limit-js-c2402f90bd11
assert-that-the-sla-calculation-utility-correctly-identifies-breached-support-tickets-when-response-times-exceed-the-twenty-four-hour-limit
customer-support
test
Assert that the SLA calculation utility correctly identifies breached support tickets when response times exceed the twenty-four hour limit.
js
import test from 'node:test'; import assert from 'node:assert/strict'; import { calculateTicketSla } from '../src/support/sla.js'; const createdAt = '2025-03-12T09:00:00.000Z'; const responseCases = [ { id: 'SUP-801', firstResponseAt: '2025-03-13T09:00:00.001Z', elapsed: 86400001, breached: true }, { id: 'SUP-802'...
29
false
false
false
false
false
true
false
false
true
false
too_clever
3
obvious
[]
[ { "finding_slug": "too-clever-c2402f90bd11-l18-l26-5fdbd334", "flag": "too_clever", "start_line": 18, "end_line": 26, "excerpt": " responseCases.reduce((breachedIds, expected) => {", "explanation": "The reducer combines result lookup, assertions, and collection of breached IDs using a com...
build-a-custom-hook-that-fetches-enterprise-usage-metrics-and-polls-the-billing-service-endpoint-every-thirty-seconds-ts-129ff1a4a5cf
build-a-custom-hook-that-fetches-enterprise-usage-metrics-and-polls-the-billing-service-endpoint-every-thirty-seconds
subscription-billing
react-hook
Build a custom hook that fetches enterprise usage metrics and polls the billing service endpoint every thirty seconds.
ts
import useSWR from 'swr' const BILLING_USAGE_ENDPOINT = '/api/v1/billing/enterprise/usage' const POLLING_INTERVAL_MS = 30000 export type UsageMetricRecord = { organizationId: string activeSeats: number computeHoursUsed: number storageBytesAllocated: number currentPeriodEnd: string } async functio...
75
false
false
false
false
false
false
true
false
false
false
duplicated_logic
4
subtle
[]
[ { "finding_slug": "duplicated-logic-129ff1a4a5cf-l26-l43-d7ec0a77", "flag": "duplicated_logic", "start_line": 26, "end_line": 43, "excerpt": " if (!('activeSeats' in payload) || typeof payload.activeSeats !== 'number') {", "explanation": "The same presence/type and finite/nonnegative chec...
process-incoming-webhook-payloads-from-payment-gateways-verifying-hmac-signatures-before-updating-customer-account-balances-ts-b49b34b363b0
process-incoming-webhook-payloads-from-payment-gateways-verifying-hmac-signatures-before-updating-customer-account-balances
banking
http-handler
Process incoming webhook payloads from payment gateways, verifying HMAC signatures before updating customer account balances.
ts
import type { ServerRoute } from "@hapi/hapi"; import Boom from "@hapi/boom"; import { createHmac, timingSafeEqual } from "node:crypto"; import { z } from "zod"; import { paymentGatewaySecret } from "../config/payments.js"; import { ledger } from "../accounts/ledger.js"; const creditEventSchema = z.object({ eventId:...
63
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
normalize-raw-ldap-group-memberships-into-structured-permission-claims-for-the-downstream-token-generator-ts-37c558373bf4
normalize-raw-ldap-group-memberships-into-structured-permission-claims-for-the-downstream-token-generator
permissions
data-transform
Normalize raw LDAP group memberships into structured permission claims for the downstream token generator.
ts
import { z } from "zod"; export interface PermissionClaim { scope: string; resource: string; } const membershipSchema = z.array(z.object({ dn: z.string().regex(/^cn=[^,]+/i), })); export function normalizeLdapMemberships(rawEntries: unknown): Promise<PermissionClaim[]> { return Promise.resolve().then...
30
false
true
false
false
false
true
false
false
false
false
too_clever
3
subtle
[]
[ { "finding_slug": "noise-comments-37c558373bf4-l15-l15-1e760f36", "flag": "noise_comments", "start_line": 15, "end_line": 15, "excerpt": " // Convert LDAP group names to read claims.", "explanation": "Restates the mapping directly below without explaining a rationale or adding informa...
queue-and-dispatch-nightly-invoice-reminder-emails-to-clients-holding-unpaid-orders-past-their-net-thirty-payment-deadline-ts-8a921f9b5527
queue-and-dispatch-nightly-invoice-reminder-emails-to-clients-holding-unpaid-orders-past-their-net-thirty-payment-deadline
order-management
async-job
Queue and dispatch nightly invoice reminder emails to clients holding unpaid orders past their net thirty payment deadline
ts
import { z } from 'zod'; import type { Queue } from 'bullmq'; const eventSchema = z.object({ type: z.literal('invoices.nightly'), id: z.string().regex(/^[A-Za-z0-9-]+$/), runAt: z.string().datetime({ offset: true }), orders: z.array(z.object({ id: z.string().regex(/^[A-Za-z0-9-]+$/), email: z.strin...
27
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
format-a-numeric-monetary-amount-into-a-localized-currency-string-using-iso-currency-codes-and-user-locale-settings-js-5e617ad69b81
format-a-numeric-monetary-amount-into-a-localized-currency-string-using-iso-currency-codes-and-user-locale-settings
invoicing
utility
Format a numeric monetary amount into a localized currency string using ISO currency codes and user locale settings.
js
function formatMoney(amount, currency, locale = "en-US") { if (typeof amount !== "number" || !Number.isFinite(amount)) { throw new TypeError("Invoice amount must be a finite number") } if (typeof currency !== "string" || !/^[A-Za-z]{3}$/.test(currency)) { throw new TypeError("Invoice currency must be a t...
24
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]
provide-debounced-search-results-for-the-customer-support-lookup-input-by-polling-the-order-history-endpoint-after-user-pauses-typing-js-8f6293f15767
provide-debounced-search-results-for-the-customer-support-lookup-input-by-polling-the-order-history-endpoint-after-user-pauses-typing
order-management
react-hook
Provide debounced search results for the customer support lookup input by polling the order history endpoint after user pauses typing
js
import { useEffect, useState } from "react"; import { useQuery } from "@tanstack/react-query"; import { z } from "zod"; const orderSchema = z.object({ id: z.string().min(1), status: z.enum(["pending", "shipped", "cancelled"]), placedAt: z.string().datetime(), }); const historySchema = z.object({ openOrders: z.arra...
48
false
false
false
true
false
false
true
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "inconsistent-style-8f6293f15767-l32-l32-819ede99", "flag": "inconsistent_style", "start_line": 32, "end_line": 32, "excerpt": "\t\t\t\tconst ledger = await response.json().then(payload => historySchema.parse(payload));", "explanation": "This mixes a .then chain with await ...
define-typescript-interfaces-for-user-profile-preferences-notification-settings-and-privacy-permissions-ts-58f72d70f438
define-typescript-interfaces-for-user-profile-preferences-notification-settings-and-privacy-permissions
user-profiles
type-definitions
Define TypeScript interfaces for user profile preferences, notification settings, and privacy permissions.
ts
export type ThemeMode = 'light' | 'dark' | 'system'; export type LanguageCode = 'en-US' | 'es-ES' | 'fr-FR' | 'de-DE'; export interface NotificationSettings { emailAlerts: boolean; pushAlerts: boolean; smsAlerts: boolean; digestFrequency: 'realtime' | 'daily' | 'weekly'; } export interface PrivacyPermissions ...
37
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]
dispatch-automated-email-reminders-to-clients-twenty-four-hours-before-their-scheduled-consultation-session-begins-ts-264ce0eb4839
dispatch-automated-email-reminders-to-clients-twenty-four-hours-before-their-scheduled-consultation-session-begins
scheduling
async-job
Dispatch automated email reminders to clients twenty-four hours before their scheduled consultation session begins.
ts
import { Agenda } from 'agenda'; import { PrismaClient } from '@prisma/client'; import { createTransport } from 'nodemailer'; import { z } from 'zod'; const prisma = new PrismaClient(); const smtpUrl = process.env.SMTP_URL ?? ''; const transporter = createTransport(smtpUrl); const payloadSchema = z.object({ consultati...
57
false
false
false
false
true
false
false
false
false
true
over_abstracted
3
subtle
[]
[ { "finding_slug": "unsafe-input-264ce0eb4839-l7-l8-496e8050", "flag": "unsafe_input", "start_line": 7, "end_line": 8, "excerpt": "const smtpUrl = process.env.SMTP_URL ?? '';", "explanation": "The environment value is passed to the mail transport without validating its URL or protocol, since ...
calculate-the-hierarchical-inheritance-path-for-nested-security-groups-to-resolve-effective-rights-ts-ffe70965859a
calculate-the-hierarchical-inheritance-path-for-nested-security-groups-to-resolve-effective-rights
permissions
utility
Calculate the hierarchical inheritance path for nested security groups to resolve effective rights.
ts
import _ from 'lodash'; import { z } from 'zod'; export interface SecurityGroupNode { id: string; name: string; parentGroupId: string | null; } export interface GroupRepository { findById(id: string): Promise<SecurityGroupNode | null>; } const s = z.object({ id: z.string(), name: z.string(), parentGroupId: z.strin...
42
true
false
false
false
false
false
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-ffe70965859a-l12-l12-24cbdd1e", "flag": "unclear_naming", "start_line": 12, "end_line": 12, "excerpt": "const s = z.object({ id: z.string(), name: z.string(), parentGroupId: z.string().nullable() });", "explanation": "The name s does not identify the securit...
query-the-relational-database-to-fetch-overdue-invoices-alongside-client-email-addresses-for-automated-payment-reminders-ts-3f15b0a0c803
query-the-relational-database-to-fetch-overdue-invoices-alongside-client-email-addresses-for-automated-payment-reminders
invoicing
database-access
Query the relational database to fetch overdue invoices alongside client email addresses for automated payment reminders.
ts
import { and, asc, eq, gt, lt } from "drizzle-orm"; import { z } from 'zod'; import { db } from "../db"; import { clients, invoices } from '../db/schema'; export async function fetchOverdueInvoices(cutoff: string) { const validatedCutoff = z.string().datetime({ offset: true }).parse(cutoff); let due_before: Date; ...
25
true
false
false
true
false
true
false
false
false
false
too_clever
3
obvious
[]
[ { "finding_slug": "inconsistent-style-3f15b0a0c803-l1-l4-ec84fa16", "flag": "inconsistent_style", "start_line": 1, "end_line": 4, "excerpt": "import { and, asc, eq, gt, lt } from \"drizzle-orm\";", "explanation": "Import specifiers alternate between double and single quotes within the same s...
process-the-submitted-campaign-creation-form-payload-and-persist-the-new-scheduled-dispatch-ts-7b033ef79ada
process-the-submitted-campaign-creation-form-payload-and-persist-the-new-scheduled-dispatch
email-campaigns
server-action
Process the submitted campaign creation form payload and persist the new scheduled dispatch.
ts
'use server'; import { revalidatePath } from 'next/cache'; import { redirect } from 'next/navigation'; import { db } from '@/lib/database'; import { emailCampaignsTable } from '@/lib/database/schema'; import { requireAuthenticatedUser } from '@/lib/auth/session'; export async function createScheduledCampaignDispatch(...
30
false
false
false
false
false
false
false
false
false
true
unsafe_input
2
subtle
[]
[ { "finding_slug": "unsafe-input-7b033ef79ada-l19-l23-899c71c0", "flag": "unsafe_input", "start_line": 19, "end_line": 23, "excerpt": " title: String(campaignTitle ?? ''),", "explanation": "All five submitted fields are persisted without validation because string coercion and empty-str...
calculate-total-cost-for-a-stay-duration-including-weekend-surcharges-and-local-tourist-tax-rates-ts-36b7eca6a5c6
calculate-total-cost-for-a-stay-duration-including-weekend-surcharges-and-local-tourist-tax-rates
hotel-booking
utility
Calculate total cost for a stay duration including weekend surcharges and local tourist tax rates.
ts
import { z } from 'zod' const pricingInputSchema = z.object({ checkInDate: z.string().date(), checkOutDate: z.string().date(), nightlyRate: z.number().finite().nonnegative(), weekendSurchargeRate: z.number().finite().nonnegative(), touristTaxPerNight: z.number().finite().nonnegative(), currency...
45
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
manage-infinite-scrolling-pagination-and-automatic-data-fetching-when-users-browse-lengthy-customer-feedback-threads-js-c64577c4cd29
manage-infinite-scrolling-pagination-and-automatic-data-fetching-when-users-browse-lengthy-customer-feedback-threads
reviews
react-hook
Manage infinite scrolling pagination and automatic data fetching when users browse lengthy customer feedback threads.
js
import { useCallback, useEffect, useRef, useState } from 'react' const reviewTransport = { fetchPage(url) { return fetch(url) } } export function useReviewThreadPagination(initialCursor) { const cursor = useRef(initialCursor) const pending = useRef(false) const exhausted = useRef(false) const started ...
65
false
false
false
true
true
false
false
false
false
false
over_abstracted
3
subtle
[]
[ { "finding_slug": "over-abstracted-c64577c4cd29-l3-l7-af654747", "flag": "over_abstracted", "start_line": 3, "end_line": 7, "excerpt": "const reviewTransport = {", "explanation": "The reviewTransport object contains only a method forwarding its argument and result to fetch without extra poli...
write-a-mutation-handler-processing-bulk-price-updates-for-selected-category-items-and-revalidating-the-storefront-cache-ts-c82c8401d5e2
write-a-mutation-handler-processing-bulk-price-updates-for-selected-category-items-and-revalidating-the-storefront-cache
product-catalog
server-action
Write a mutation handler processing bulk price updates for selected category items and revalidating the storefront cache.
ts
import { z } from 'zod' import { TRPCError } from '@trpc/server' import { revalidatePath } from 'next/cache' import { catalogAdminProcedure } from '@/server/trpc' const priceUpdateInput = z.object({ categoryId: z.string(), itemIds: z.array(z.string()).min(1).max(500), priceCents: z.number().optional() }).strict(...
42
false
false
false
false
false
false
false
false
true
false
type_safety_hole
4
borderline
[ "type_safety_hole" ]
[ { "finding_slug": "type-safety-hole-c82c8401d5e2-l26-l26-cd89eb95", "flag": "type_safety_hole", "start_line": 26, "end_line": 26, "excerpt": " const priceCents = input.priceCents!", "explanation": "The non-null assertion explicitly bypasses checking even though the preceding undefined gua...
query-active-subscribers-matching-specific-segment-criteria-for-the-upcoming-newsletter-dispatch-js-716b68b1f613
query-active-subscribers-matching-specific-segment-criteria-for-the-upcoming-newsletter-dispatch
email-campaigns
database-access
Query active subscribers matching specific segment criteria for the upcoming newsletter dispatch.
js
import { z } from 'zod'; const timestamp = z.number().int().nonnegative().max(8640000000000000); const text = z.string().min(1); const segmentSchema = z.object({ locale: text, topic: text, dispatchAt: timestamp }); const subscriberSchema = z.object({ id: text, email: z.string().email(), locale: text, topics: z.arr...
34
false
false
false
false
false
true
false
true
false
false
error_handling_problem
2
obvious
[]
[ { "finding_slug": "too-clever-716b68b1f613-l20-l27-b9bfac77", "flag": "too_clever", "start_line": 20, "end_line": 27, "excerpt": " return payloads.reduce((selected, payload, index) => {", "explanation": "The reducer combines parsing and integrity checks, eligibility filtering, and result ...
export-all-active-course-enrollments-to-a-compressed-archive-file-on-local-disk-and-log-total-records-processed-js-f5f9a2daa7dd
export-all-active-course-enrollments-to-a-compressed-archive-file-on-local-disk-and-log-total-records-processed
course-management
cli-script
Export all active course enrollments to a compressed archive file on local disk and log total records processed.
js
import { execFile } from "node:child_process" import { promisify } from "node:util" import { mkdir, writeFile } from "node:fs/promises" import { join } from "node:path" import { parse } from "csv-parse/sync" const execFileAsync = promisify(execFile) export async function runCourseEnrollmentExport() { const target...
45
true
false
false
false
false
false
true
false
false
false
duplicated_logic
3
subtle
[]
[ { "finding_slug": "unclear-naming-f5f9a2daa7dd-l17-l17-0d428553", "flag": "unclear_naming", "start_line": 17, "end_line": 17, "excerpt": " const [header, ...data] = parse(stdout)", "explanation": "The name data does not identify the parsed enrollment rows it holds.", "audit_verdict": ...
query-the-relational-database-to-fetch-overdue-invoices-alongside-client-email-addresses-for-automated-payment-reminders-ts-f4eac9b0140b
query-the-relational-database-to-fetch-overdue-invoices-alongside-client-email-addresses-for-automated-payment-reminders
invoicing
database-access
Query the relational database to fetch overdue invoices alongside client email addresses for automated payment reminders.
ts
import { and, asc, eq, gt, lt } from "drizzle-orm"; import { z } from "zod"; import { db } from "../db"; import { clients, invoices } from "../db/schema"; export async function fetchOverdueInvoices(cutoff: string) { const boundary = new Date(z.string().datetime({ offset: true }).parse(cutoff)); return await db.sel...
17
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
query-the-postgresql-database-to-retrieve-full-user-profile-records-including-encrypted-notification-preferences-ts-c064a40ead93
query-the-postgresql-database-to-retrieve-full-user-profile-records-including-encrypted-notification-preferences
user-profiles
database-access
Query the PostgreSQL database to retrieve full user profile records including encrypted notification preferences.
ts
import type { Pool } from "pg"; import type Redis from "ioredis"; import { z } from "zod"; const userIdSchema = z.string().uuid(); const profileSchema = z.object({ id: userIdSchema, email: z.string().email(), displayName: z.string(), bio: z.string().nullable(), avatarUrl: z.string().url().nullable(...
58
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
process-incoming-webhook-payloads-from-external-syndication-partners-to-publish-verified-property-feeds-js-7a7d97b25394
process-incoming-webhook-payloads-from-external-syndication-partners-to-publish-verified-property-feeds
property-listings
async-job
Process incoming webhook payloads from external syndication partners to publish verified property feeds.
js
import { z } from 'zod'; const webhookSchema = z.object({ feedId: z.string().min(1), properties: z.array(z.object({ listingId: z.string().min(1), address: z.string().min(1), price: z.number().finite().nonnegative(), verified: z.boolean() })) }); export function registerPropertyFeedJob(agenda, pu...
35
false
false
false
false
false
true
false
false
false
true
too_clever
2
obvious
[]
[ { "finding_slug": "too-clever-7a7d97b25394-l16-l28-82ee6263", "flag": "too_clever", "start_line": 16, "end_line": 28, "excerpt": " const listings = webhook.properties.reduce((ordered, property) => {", "explanation": "This reducer combines filtering, projection, and insertion sorting with ...
manage-selected-dates-filter-slice-and-active-room-type-filters-in-client-search-results-store-js-142432883654
manage-selected-dates-filter-slice-and-active-room-type-filters-in-client-search-results-store
hotel-booking
state-management
Manage selected dates filter slice and active room type filters in client search results store.
js
import create from "zustand"; import { z } from "zod"; const roomTypes = ["standard", "deluxe", "suite"]; const dateRange = z.object({ checkInDate: z.string().date().nullable(), checkOutDate: z.string().date().nullable(), }).refine(({ checkInDate, checkOutDate }) => !checkInDate || !checkOutDate || checkInDate <= ...
44
false
false
false
false
true
false
false
false
false
false
over_abstracted
3
subtle
[]
[ { "finding_slug": "over-abstracted-142432883654-l11-l26-4c91f54c", "flag": "over_abstracted", "start_line": 11, "end_line": 26, "excerpt": "class FilterUpdateBuilder {", "explanation": "A mutable fluent builder adds construction, chaining, and a build step solely to produce the store's small...
define-typescript-interfaces-for-event-schedules-ticket-tier-pricing-models-and-venue-accessibility-features-ts-67ea6a7af2d3
define-typescript-interfaces-for-event-schedules-ticket-tier-pricing-models-and-venue-accessibility-features
event-ticketing
type-definitions
Define TypeScript interfaces for event schedules, ticket tier pricing models, and venue accessibility features.
ts
export interface TicketTierPricing { tierId: string basePriceCents: number serviceFeeCents: number taxRate: number } export interface VenueAccessibility { venueId: string hasWheelchairAccess: boolean hasSignLanguageInterpreter: boolean hasAssistiveListeningSystem: boolean hasBrailleSignage: boolean } export in...
22
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]
reshape-raw-feature-flag-audit-logs-into-a-chronological-timeline-grouped-by-administrator-email-address-and-action-type-ts-e0bb73b71402
reshape-raw-feature-flag-audit-logs-into-a-chronological-timeline-grouped-by-administrator-email-address-and-action-type
feature-flags
data-transform
Reshape raw feature flag audit logs into a chronological timeline grouped by administrator email address and action type.
ts
import _ from "lodash" import { z } from "zod" const auditEntrySchema = z.object({ id: z.string().min(1), timestamp: z.string().datetime({ offset: true }), adminEmail: z.string().email(), actionType: z.string().min(1), flagKey: z.string().min(1), changes: z.record(z.string(), z.unknown()) }) ex...
39
false
true
false
false
false
false
false
false
true
false
type_safety_hole
3
obvious
[]
[ { "finding_slug": "noise-comments-e0bb73b71402-l23-l23-342a7125", "flag": "noise_comments", "start_line": 23, "end_line": 23, "excerpt": " // Validate the audit entries", "explanation": "Repeats the schema parse immediately below without explaining a constraint or rationale.", "audit_...
render-a-modal-dialog-displaying-high-resolution-listing-photos-in-a-responsive-masonry-layout-grid-tsx-b2a6ea2b5ea5
render-a-modal-dialog-displaying-high-resolution-listing-photos-in-a-responsive-masonry-layout-grid
property-listings
react-component
Render a modal dialog displaying high-resolution listing photos in a responsive masonry layout grid.
tsx
import { useContext, useEffect, useReducer, useRef } from 'react' import { z } from 'zod' import { ListingContext } from '../context/ListingContext' const gallerySchema = z.object({ photos: z.array(z.object({ id: z.string().min(1), highResUrl: z.string().url(), caption: z.string() })) }) type Photo = z.infer<typeof ...
61
false
false
false
true
false
false
false
false
true
false
type_safety_hole
3
subtle
[]
[ { "finding_slug": "inconsistent-style-b2a6ea2b5ea5-l47-l47-d60468eb", "flag": "inconsistent_style", "start_line": 47, "end_line": 47, "excerpt": " const select_photo = (photo: any) => dispatch({ type: 'select', id: photo.id })", "explanation": "select_photo uses snake_case alongside camelCa...
query-the-postgresql-database-to-retrieve-all-active-prescriptions-associated-with-a-specific-patient-identifier-ts-99beaf2a8efc
query-the-postgresql-database-to-retrieve-all-active-prescriptions-associated-with-a-specific-patient-identifier
clinic-appointments
database-access
Query the PostgreSQL database to retrieve all active prescriptions associated with a specific patient identifier.
ts
import { Pool } from 'pg'; import { z } from 'zod'; const patientIdentifier = z.string().uuid(); const prescriptionRow = z.object({ id: z.string().uuid(), medication: z.string().min(1), dosage: z.string().min(1), startsAt: z.date(), endsAt: z.date().nullable(), }); export type Prescription = { id: string;...
47
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
export-typescript-interfaces-for-cart-item-models-discount-structures-and-shipping-address-parameters-ts-b0c42546a521
export-typescript-interfaces-for-cart-item-models-discount-structures-and-shipping-address-parameters
shopping-cart
type-definitions
Export TypeScript interfaces for cart item models, discount structures, and shipping address parameters
ts
export interface PercentageDiscount { kind: "percentage"; basisPoints: number } export interface FixedDiscount { kind: "fixed"; amountCents: number } export type Discount = PercentageDiscount | FixedDiscount export interface CartItem { sku: string; title: string; quantity: number; unitPriceCents: number; discounts: D...
14
false
false
false
false
true
false
false
false
false
false
over_abstracted
4
subtle
[]
[ { "finding_slug": "over-abstracted-b0c42546a521-l10-l12-e23bcaba", "flag": "over_abstracted", "start_line": 10, "end_line": 12, "excerpt": "function createShippingAddressDefaults(options: { countryCode: string }): ShippingAddressParams {", "explanation": "This private factory introduces an o...
format-integer-minor-currency-units-into-localized-string-representations-with-the-appropriate-iso-currency-symbol-prefix-ts-7cd6a374cf6e
format-integer-minor-currency-units-into-localized-string-representations-with-the-appropriate-iso-currency-symbol-prefix
subscription-billing
utility
Format integer minor-currency units into localized string representations with the appropriate ISO currency symbol prefix.
ts
const invoiceCurrencyDigits = new Map([ ["USD", 2], ["JPY", 0], ["KWD", 3] ]) export default function formatBillingAmount(minorUnits: number, currency: string, locale = "en-US"): string { const currencyFormat = new Intl.NumberFormat(locale, { style: "currency", currency }) const digits = currencyFo...
17
false
false
true
false
false
false
false
false
false
false
dead_code
4
subtle
[]
[ { "finding_slug": "dead-code-7cd6a374cf6e-l1-l5-1217a7f7", "flag": "dead_code", "start_line": 1, "end_line": 5, "excerpt": "const invoiceCurrencyDigits = new Map([", "explanation": "This local map is never referenced or exported, and currency precision is instead obtained from Intl.NumberFor...
format-integer-minor-currency-units-into-localized-string-representations-with-the-appropriate-iso-currency-symbol-prefix-ts-34048e03ab10
format-integer-minor-currency-units-into-localized-string-representations-with-the-appropriate-iso-currency-symbol-prefix
subscription-billing
utility
Format integer minor-currency units into localized string representations with the appropriate ISO currency symbol prefix.
ts
export default function formatBillingAmount(minorUnits: number, currency: string, locale = "en-US"): string { if (!Number.isSafeInteger(minorUnits)) throw new RangeError("Expected safe integer minor units") if (typeof currency !== "string" || !/^[A-Z]{3}$/.test(currency)) throw new TypeError("Expected an ISO cu...
10
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
attach-keydown-listeners-to-the-backup-recovery-code-input-fields-to-auto-advance-focus-between-boxes-ts-5d7f73d64abb
attach-keydown-listeners-to-the-backup-recovery-code-input-fields-to-auto-advance-focus-between-boxes
auth
dom-code
Attach keydown listeners to the backup recovery code input fields to auto-advance focus between boxes
ts
import { verifyBackupCode } from "../api/authClient.js"; export async function initBackupCodeInputs(container: HTMLElement): Promise<void> { const inputs = Array.from(container.querySelectorAll("input.recovery-code-digit")); const form = container.closest("form"); if (!form || inputs.length !== 8 || !inputs.ever...
43
false
false
false
false
false
false
false
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "error-handling-problem-5d7f73d64abb-l40-l41-3161db66", "flag": "error_handling_problem", "start_line": 40, "end_line": 41, "excerpt": " } catch {", "explanation": "The empty catch discards verification failures and leaves the alert empty, so the user receives no indicat...
provide-a-debounced-search-term-state-and-trigger-live-venue-queries-against-the-ticket-catalog-js-bbd184534e32
provide-a-debounced-search-term-state-and-trigger-live-venue-queries-against-the-ticket-catalog
event-ticketing
react-hook
Provide a debounced search term state and trigger live venue queries against the ticket catalog.
js
import { useEffect, useState } from "react"; export function useVenueSearch() { const [term, setTerm] = useState(""); const [debouncedTerm, setDebouncedTerm] = useState(""); const [venues, setVenues] = useState([]); const [error, setError] = useState(null); const [step, setStep] = useState(0); useEffect((...
48
true
false
false
false
false
false
false
false
false
true
unsafe_input
3
subtle
[]
[ { "finding_slug": "unclear-naming-bbd184534e32-l8-l8-bd4ce892", "flag": "unclear_naming", "start_line": 8, "end_line": 8, "excerpt": " const [step, setStep] = useState(0);", "explanation": "The value step is a catalog refresh revision rather than a step in a sequence, so naming it refreshVe...
define-typescript-interfaces-representing-signer-roles-authentication-methods-and-cryptographic-certificate-metadata-ts-93aeb61b2800
define-typescript-interfaces-representing-signer-roles-authentication-methods-and-cryptographic-certificate-metadata
document-signing
type-definitions
Define TypeScript interfaces representing signer roles, authentication methods, and cryptographic certificate metadata.
ts
export type SignerRole = 'primary' | 'witness' | 'notary' | 'approver'; export type AuthenticationMethod = 'sms' | 'email' | 'oauth' | 'hardware_token'; export interface CertificateMetadata { issuer: string; serialNumber: string; validFrom: string; validTo: string; thumbprint: string; } export int...
31
false
false
false
false
false
false
true
false
false
false
duplicated_logic
4
subtle
[]
[ { "finding_slug": "duplicated-logic-93aeb61b2800-l20-l29-08dd98fa", "flag": "duplicated_logic", "start_line": 20, "end_line": 29, "excerpt": " if (config.role === 'primary') {", "explanation": "The primary and witness branches repeat exactly the same authentication and order validation, s...
attach-native-clipboard-copy-handlers-to-shareable-event-invitation-links-on-the-confirmation-landing-page-js-8dce9e5b8099
attach-native-clipboard-copy-handlers-to-shareable-event-invitation-links-on-the-confirmation-landing-page
event-ticketing
dom-code
Attach native clipboard copy handlers to shareable event invitation links on the confirmation landing page.
js
import $ from 'jquery'; import { trackShareEvent } from '../analytics/tracker.js'; function writeInvitationClipboard(invitationUrl) { return navigator.clipboard.writeText(invitationUrl); } export async function initInviteCopyHandlers() { const pendingTriggers = new WeakSet(); $('.js-share-invite-link').on('clic...
39
false
false
false
false
true
false
false
false
false
false
over_abstracted
4
borderline
[ "over_abstracted" ]
[ { "finding_slug": "over-abstracted-8dce9e5b8099-l4-l6-fbdbfef3", "flag": "over_abstracted", "start_line": 4, "end_line": 6, "excerpt": "function writeInvitationClipboard(invitationUrl) {", "explanation": "This helper only forwards its argument and return value to navigator.clipboard.writeTex...
draft-a-command-line-script-importing-csv-catalog-feeds-and-upserting-product-records-into-the-primary-database-cluster-ts-5b65e2383cf7
draft-a-command-line-script-importing-csv-catalog-feeds-and-upserting-product-records-into-the-primary-database-cluster
product-catalog
cli-script
Draft a command-line script importing CSV catalog feeds and upserting product records into the primary database cluster.
ts
import { readFile, stat } from "node:fs/promises"; import { resolve } from "node:path"; import { createInterface } from "node:readline/promises"; import { parse } from "csv-parse/sync"; import { z } from "zod"; import { databaseClusterPool } from "../infrastructure/database.js"; const catalogRows = z.array(z.object({ ...
43
false
false
true
false
false
false
false
false
false
true
unsafe_input
3
subtle
[]
[ { "finding_slug": "dead-code-5b65e2383cf7-l15-l15-6028c1c2", "flag": "dead_code", "start_line": 15, "end_line": 15, "excerpt": "const importBatchSize = 100;", "explanation": "The local constant importBatchSize is never referenced because the importer schedules individual sequential writes ra...
sanitize-user-input-strings-by-stripping-malicious-html-tags-and-formatting-explicit-urls-into-clickable-hyperlink-structures-ts-85a5c6c7f4e8
sanitize-user-input-strings-by-stripping-malicious-html-tags-and-formatting-explicit-urls-into-clickable-hyperlink-structures
messaging
utility
Sanitize user input strings by stripping malicious HTML tags and formatting explicit URLs into clickable hyperlink structures.
ts
type MessagePart = | { type: 'text'; value: string } | { type: 'link'; value: string; href: string }; export default function formatMessage(input: unknown): MessagePart[] { try { if (typeof input !== 'string') { throw new TypeError('Message must be a string'); } const te...
26
false
false
false
false
false
false
false
true
false
false
error_handling_problem
3
subtle
[]
[ { "finding_slug": "error-handling-problem-85a5c6c7f4e8-l23-l24-eef4f3e1", "flag": "error_handling_problem", "start_line": 23, "end_line": 24, "excerpt": " } catch {", "explanation": "All failures, including the explicit TypeError, are converted to an empty result with their cause discarde...
fetch-all-warehouse-stock-levels-and-batch-expiration-dates-matching-a-specific-sku-from-the-database-ts-088f8f718feb
fetch-all-warehouse-stock-levels-and-batch-expiration-dates-matching-a-specific-sku-from-the-database
inventory
database-access
Fetch all warehouse stock levels and batch expiration dates matching a specific SKU from the database.
ts
import { eq } from 'drizzle-orm'; import { db } from '../db'; import { stockLevels, inventoryBatches } from '../db/schema'; export type StockLevelWithBatches = { sku: string; warehouseId: string; quantityOnHand: number; batchNumber: string | null; expirationDate: Date | null; }; export async funct...
38
true
false
false
false
false
true
false
false
false
false
too_clever
3
subtle
[]
[ { "finding_slug": "unclear-naming-088f8f718feb-l14-l14-eeb1bce3", "flag": "unclear_naming", "start_line": 14, "end_line": 14, "excerpt": " let t = '';", "explanation": "The single-letter local t hides that it holds the trimmed SKU, whereas normalizedSku would convey its role.", "audit...
process-incoming-webhook-payloads-from-translation-providers-and-update-article-localization-statuses-js-6b75e60f8afd
process-incoming-webhook-payloads-from-translation-providers-and-update-article-localization-statuses
content-publishing
async-job
Process incoming webhook payloads from translation providers and update article localization statuses.
js
const { z } = require('zod'); const database = require('./services/database'); const deliverySchema = z.object({ Records: z.array(z.object({ body: z.string() })) }); const translationSchema = z.object({ articleId: z.string().trim().min(1), targetLocale: z.string().regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/), s...
61
false
false
true
false
false
false
false
false
false
false
dead_code
4
borderline
[ "dead_code" ]
[ { "finding_slug": "dead-code-6b75e60f8afd-l50-l50-eaae35e5", "flag": "dead_code", "start_line": 50, "end_line": 50, "excerpt": " function(error, updateResult) {", "explanation": "The updateResult callback parameter is never used and can be omitted without changing behavior.", "audit...
process-incoming-webhook-payloads-from-external-invoicing-providers-to-sync-payment-settlement-statuses-ts-97bf04936774
process-incoming-webhook-payloads-from-external-invoicing-providers-to-sync-payment-settlement-statuses
time-tracking
async-job
Process incoming webhook payloads from external invoicing providers to sync payment settlement statuses.
ts
import type { SQSHandler } from 'aws-lambda'; import { z } from 'zod'; import { DatabaseConnection } from '@time-tracker/database'; const db = DatabaseConnection.getInstance(); const settlement = z.object({ invoiceId: z.string().trim().min(1), status: z.enum(['settled', 'failed', 'pending']), settledAt: z.string...
24
false
false
false
false
false
true
false
false
false
false
too_clever
3
borderline
[ "dead_code" ]
[ { "finding_slug": "too-clever-97bf04936774-l22-l22-a0d54d9d", "flag": "too_clever", "start_line": 22, "end_line": 22, "excerpt": " values.map((_, index) => values[(index + 1) % values.length])", "explanation": "Cyclically rotating a tuple to construct SQL parameters obscures the requi...
check-that-executing-an-empty-search-query-returns-all-active-catalog-products-sorted-by-popularity-ts-7e13264415d7
check-that-executing-an-empty-search-query-returns-all-active-catalog-products-sorted-by-popularity
search
test
Check that executing an empty search query returns all active catalog products sorted by popularity.
ts
import test from "node:test"; import assert from "node:assert/strict"; import { searchCatalog } from "../src/search/catalog.js"; test("empty query returns all active products by descending popularity", async () => { const products = [ { id: "mug", name: "Stoneware Mug", active: true, popularity: 18 }, { id: ...
23
false
true
false
false
false
false
true
false
false
false
duplicated_logic
3
subtle
[]
[ { "finding_slug": "noise-comments-7e13264415d7-l14-l14-30cbbb69", "flag": "noise_comments", "start_line": 14, "end_line": 14, "excerpt": " // Check active products in popularity order.", "explanation": "This merely restates the filtering, sorting, and assertion immediately below it.", "...
submit-updated-employee-banking-routing-numbers-to-the-secure-vault-and-trigger-a-confirmation-email-ts-38edcb7c4c31
submit-updated-employee-banking-routing-numbers-to-the-secure-vault-and-trigger-a-confirmation-email
payroll
server-action
Submit updated employee banking routing numbers to the secure vault and trigger a confirmation email.
ts
import { fail } from '@sveltejs/kit'; import type { Actions } from './$types'; import { secureVaultClient } from '$lib/server/vault'; import { emailDispatcher } from '$lib/server/email'; import { auditLogger } from '$lib/server/audit'; import { updateEmployeeRoutingSchema } from '$lib/schemas/payroll'; export const ac...
53
true
true
false
false
false
false
true
false
false
false
duplicated_logic
3
borderline
[ "duplicated_logic" ]
[ { "finding_slug": "duplicated-logic-38edcb7c4c31-l16-l24-fc583501", "flag": "duplicated_logic", "start_line": 16, "end_line": 24, "excerpt": " const employeeId = submittedFields.get('employeeId');", "explanation": "The field extraction, string-type check, and identical failure respons...
render-a-detailed-view-panel-showing-the-exact-json-payload-diff-for-an-updated-user-permission-audit-log-entry-tsx-3d747faca242
render-a-detailed-view-panel-showing-the-exact-json-payload-diff-for-an-updated-user-permission-audit-log-entry
audit-logging
react-component
Render a detailed view panel showing the exact JSON payload diff for an updated user permission audit log entry.
tsx
import styled from 'styled-components' import { z } from 'zod' const Panel = styled.section` padding: 24px; background: #1a1a1a; color: #f5f5f5; font-family: monospace; ` const Payload = styled.pre` background: #111; padding: 16px; border-radius: 4px; overflow-x: auto; ` const entrySche...
40
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
purge-expired-email-verification-tokens-from-the-redis-cache-queue-every-midnight-via-background-worker-js-2f309dceecd7
purge-expired-email-verification-tokens-from-the-redis-cache-queue-every-midnight-via-background-worker
auth
async-job
Purge expired email verification tokens from the Redis cache queue every midnight via background worker
js
const cron = require('node-cron'); const verificationQueue = 'auth:email-verification:expiry'; async function purgeExpiredTokens(redis, now = Date.now()) { if (!Number.isSafeInteger(now) || now < 0) { throw new TypeError('Purge cutoff must be an epoch millisecond timestamp'); } const removedCount = await r...
38
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
attach-native-drag-and-drop-event-listeners-to-calendar-appointment-blocks-allowing-users-to-reschedule-by-dragging-ts-9395865adaf0
attach-native-drag-and-drop-event-listeners-to-calendar-appointment-blocks-allowing-users-to-reschedule-by-dragging
scheduling
dom-code
Attach native drag-and-drop event listeners to calendar appointment blocks allowing users to reschedule by dragging.
ts
import { updateAppointmentSchedule } from "./api/schedulingApi" const appointmentTransferType = "application/x-calendar-appointment" export function initializeAppointmentDragging(container: HTMLElement): void { container.addEventListener("dragstart", (event) => { const block = (event.target as HTMLElement...
36
false
false
false
false
false
false
false
false
true
false
type_safety_hole
3
subtle
[]
[ { "finding_slug": "type-safety-hole-9395865adaf0-l7-l7-ae3b4a86", "flag": "type_safety_hole", "start_line": 7, "end_line": 7, "excerpt": " const block = (event.target as HTMLElement).closest(\".appointment-block\")", "explanation": "The unchecked assertion treats an `EventTarget` that...
verify-user-authorization-tokens-before-generating-presigned-upload-urls-for-secure-direct-browser-media-transfers-ts-fe211d3ec61d
verify-user-authorization-tokens-before-generating-presigned-upload-urls-for-secure-direct-browser-media-transfers
file-uploads
server-action
Verify user authorization tokens before generating presigned upload URLs for secure direct browser media transfers.
ts
import { error, type Actions } from "@sveltejs/kit" import { jwtVerify } from "jose" import { z } from "zod" import { randomUUID } from "node:crypto" import { PutObjectCommand } from "@aws-sdk/client-s3" import { getSignedUrl } from "@aws-sdk/s3-request-presigner" import { mediaBucket, storage, uploadVerificationKey } ...
58
false
false
false
false
false
false
true
false
false
false
duplicated_logic
3
borderline
[ "over_abstracted", "duplicated_logic" ]
[ { "finding_slug": "duplicated-logic-fe211d3ec61d-l9-l16-9d112ebf", "flag": "duplicated_logic", "start_line": 9, "end_line": 16, "excerpt": "const imageUpload = z.object({", "explanation": "The two upload schemas repeat the same object shape and identical size-validation chain, differing only...
calculate-the-exact-value-added-tax-amount-for-cross-border-transactions-based-on-the-destination-country-postal-code-prefix-ts-d73930f187a9
calculate-the-exact-value-added-tax-amount-for-cross-border-transactions-based-on-the-destination-country-postal-code-prefix
order-management
utility
Calculate the exact value-added tax amount for cross-border transactions based on the destination country postal code prefix
ts
import Decimal from "decimal.js"; const D = Decimal.clone({ precision: 400, rounding: Decimal.ROUND_HALF_UP }); const entries = new Map([ ["CH", { n: "7.7", d: "2023-01-01T00:00:00Z" }], ["NO", { n: "25", d: "2023-01-01T00:00:00Z" }] ]); export function calculateCrossBorderVatAmount(destinationPostalCode: str...
33
true
false
false
false
false
false
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-d73930f187a9-l3-l3-b550b53c", "flag": "unclear_naming", "start_line": 3, "end_line": 3, "excerpt": "const D = Decimal.clone({ precision: 400, rounding: Decimal.ROUND_HALF_UP });", "explanation": "The single-letter name D does not communicate that this is the...
render-a-responsive-amortization-schedule-table-displaying-monthly-principal-and-interest-breakdowns-for-fixed-rate-home-loans-jsx-793ac57f0a11
render-a-responsive-amortization-schedule-table-displaying-monthly-principal-and-interest-breakdowns-for-fixed-rate-home-loans
banking
react-component
Render a responsive amortization schedule table displaying monthly principal and interest breakdowns for fixed-rate home loans.
jsx
import { createContext, useContext, useReducer } from "react" const LoanContext = createContext(null) const money = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }) export function LoanProvider({ loan, children }) { if (!loan || typeof loan !== "object" || !Number.isFinite(loan.principal...
64
false
false
false
false
false
false
false
false
false
false
none
4
subtle
[]
[]
implement-a-redux-slice-to-track-active-mortgage-application-steps-persisting-current-draft-values-across-browser-refreshes-js-7384664e6ae6
implement-a-redux-slice-to-track-active-mortgage-application-steps-persisting-current-draft-values-across-browser-refreshes
banking
state-management
Implement a Redux slice to track active mortgage application steps, persisting current draft values across browser refreshes.
js
import { createContext, createElement, useContext, useEffect, useReducer } from "react"; import { createSlice } from "@reduxjs/toolkit"; import { z } from "zod"; const storageKey = "mortgage-application:v1"; const MortgageContext = createContext(null); const stepSchema = z.enum(["applicant", "property", "finances", "r...
65
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
manage-the-multi-step-expense-wizard-navigation-state-tracking-current-active-tab-completion-status-and-validation-errors-js-3ae8b599e28d
manage-the-multi-step-expense-wizard-navigation-state-tracking-current-active-tab-completion-status-and-validation-errors
expense-reports
state-management
Manage the multi-step expense wizard navigation state, tracking current active tab completion status and validation errors.
js
const { z } = require('zod') const tabSchema = z.enum(['details', 'items', 'receipts', 'review']) const completionSchema = z.union([z.boolean(), z.literal(0), z.literal(1)]) const errorsSchema = z.record(z.string(), z.array(z.string())) function createWizardTransitionAdapter (publish) { return { apply (patch) {...
53
false
false
false
true
true
false
false
false
false
false
over_abstracted
3
subtle
[]
[ { "finding_slug": "over-abstracted-3ae8b599e28d-l7-l13-d89217c7", "flag": "over_abstracted", "start_line": 7, "end_line": 13, "excerpt": "function createWizardTransitionAdapter (publish) {", "explanation": "This adapter only wraps publish in an apply method without adding behavior, introduci...
receive-incoming-binary-attachment-payloads-from-api-clients-and-pipe-data-streams-directly-into-cloud-object-storage-js-840e170099cb
receive-incoming-binary-attachment-payloads-from-api-clients-and-pipe-data-streams-directly-into-cloud-object-storage
file-uploads
http-handler
Receive incoming binary attachment payloads from API clients and pipe data streams directly into cloud object storage.
js
import { S3Client, DeleteObjectCommand } from "@aws-sdk/client-s3"; import { Upload } from "@aws-sdk/lib-storage"; const storage = new S3Client({ region: "us-east-1" }); const bucket = "enterprise-file-storage"; export default async function uploadHandler(fastify) { fastify.post("/api/uploads", async (request, reply...
31
false
false
false
false
false
true
false
false
false
true
unsafe_input
2
subtle
[]
[ { "finding_slug": "unsafe-input-840e170099cb-l13-l14-64fa2e13", "flag": "unsafe_input", "start_line": 13, "end_line": 14, "excerpt": "\t\tconst folderHeader = request.headers[\"x-user-folder\"];", "explanation": "Neither the client-controlled folder header nor the attachment filename is vali...
fetch-paginated-article-records-filtered-by-author-identifier-and-sorted-by-descending-publication-date-ts-d09e7fa2880d
fetch-paginated-article-records-filtered-by-author-identifier-and-sorted-by-descending-publication-date
content-publishing
database-access
Fetch paginated article records filtered by author identifier and sorted by descending publication date.
ts
import { Pool } from "pg"; import { z } from "zod"; const articleSchema = z.object({ id: z.string(), title: z.string(), slug: z.string(), content: z.string(), authorId: z.string(), publishedAt: z.date(), }); export type ArticleRecord = z.infer<typeof articleSchema>; export interface FetchArticlesOptions { autho...
40
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
render-a-rich-text-toolbar-allowing-marketers-to-insert-personalization-tokens-into-their-email-body-tsx-84acb6f17fba
render-a-rich-text-toolbar-allowing-marketers-to-insert-personalization-tokens-into-their-email-body
email-campaigns
react-component
Render a rich text toolbar allowing marketers to insert personalization tokens into their email body.
tsx
import { useState } from 'react'; interface PersonalizationToolbarProps { onInsertToken: (token: string) => void; } const entries = ['First Name', 'Last Name', 'Company', 'Unsubscribe Link']; export function PersonalizationToolbar({ onInsertToken }: PersonalizationToolbarProps) { const [v, sv] = useState(''); cons...
26
true
false
false
false
false
true
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-84acb6f17fba-l9-l9-94a7821c", "flag": "unclear_naming", "start_line": 9, "end_line": 9, "excerpt": "\tconst [v, sv] = useState('');", "explanation": "Neither the state nor its setter identifies the insertion success message it holds.", "audit_verdict": "...
calculate-the-weighted-average-score-across-all-published-ratings-and-group-them-by-month-for-trend-analysis-js-489a3e456d1b
calculate-the-weighted-average-score-across-all-published-ratings-and-group-them-by-month-for-trend-analysis
reviews
data-transform
Calculate the weighted average score across all published ratings and group them by month for trend analysis.
js
import { z } from "zod"; const ratingsSchema = z.array(z.object({ published: z.boolean(), score: z.number().finite().min(0).max(5), weight: z.number().finite().positive(), publishedAt: z.number().int().min(0).max(253402300799999) })); function newTotals() { return { weightedSum: 0, totalWeight: 0, count: 0 }; } ...
43
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
flatten-nested-purchase-order-line-items-and-compute-subtotal-sums-grouped-by-product-category-for-the-monthly-revenue-report-ts-0f09c4fcb09d
flatten-nested-purchase-order-line-items-and-compute-subtotal-sums-grouped-by-product-category-for-the-monthly-revenue-report
order-management
data-transform
Flatten nested purchase order line items and compute subtotal sums grouped by product category for the monthly revenue report
ts
import { startOfMonth, endOfMonth, isValid, parseISO } from "date-fns"; import { z } from "zod"; const isoDate = z.string().refine(value => isValid(parseISO(value))); const lineSchema = z.object({ itemId: z.string().min(1), productCategory: z.string().min(1), quantity: z.number().int().nonnegative().finite(), ...
45
false
true
false
true
true
true
false
false
false
false
inconsistent_style
3
obvious
[]
[ { "finding_slug": "over-abstracted-0f09c4fcb09d-l20-l20-ba19dfce", "flag": "over_abstracted", "start_line": 20, "end_line": 20, "excerpt": "const readRevenueBatch = (orders: PurchaseOrderRecord[]) => purchaseBatchSchema.parseAsync(orders);", "explanation": "This single-use wrapper only forwa...
create-a-custom-hook-that-debounces-sprint-planning-board-search-inputs-and-synchronizes-query-parameters-to-the-url-js-cf7f1902fd27
create-a-custom-hook-that-debounces-sprint-planning-board-search-inputs-and-synchronizes-query-parameters-to-the-url
project-management
react-hook
Create a custom hook that debounces sprint planning board search inputs and synchronizes query parameters to the URL.
js
import { useState, useEffect, useCallback } from 'react' import { useSearchParams } from 'react-router-dom' const STORAGE_PREFIX = 'sprint-board-' export function useSprintSearch(boardId) { const [searchParams, setSearchParams] = useSearchParams() if (typeof boardId !== 'string' || boardId.length === 0) { thr...
45
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
calculate-the-total-estimated-duration-in-working-days-for-a-project-task-list-excluding-weekends-ts-c943119fe2b6
calculate-the-total-estimated-duration-in-working-days-for-a-project-task-list-excluding-weekends
project-management
utility
Calculate the total estimated duration in working days for a project task list, excluding weekends.
ts
import { z } from 'zod'; const taskSchema = z.object({ id: z.string().min(1), startDate: z.string().date(), endDate: z.string().date(), }).refine((task) => task.startDate <= task.endDate, { message: 'Task end date precedes start date', }); export type TaskItem = z.infer<typeof taskSchema>; interface Duration...
36
false
false
false
false
true
true
false
false
false
false
over_abstracted
3
obvious
[]
[ { "finding_slug": "over-abstracted-c943119fe2b6-l13-l27-b78ad671", "flag": "over_abstracted", "start_line": 13, "end_line": 27, "excerpt": "interface DurationStrategy {", "explanation": "The `DurationStrategy` interface and its sole implementation introduce a polymorphic structure for a sing...
group-completed-patient-visits-by-medical-department-and-calculate-total-billing-revenue-per-specialty-js-8dd4b8a17782
group-completed-patient-visits-by-medical-department-and-calculate-total-billing-revenue-per-specialty
clinic-appointments
data-transform
Group completed patient visits by medical department and calculate total billing revenue per specialty.
js
const { z } = require('zod'); const visitBatch = z.array(z.object({ department: z.string().trim().min(1), status: z.enum(['scheduled', 'completed', 'cancelled']), billedCents: z.number().int().nonnegative().safe() })); function summarizeVisits(payload) { try { return Array.from( visitBatch.parse(pay...
26
false
false
true
false
false
true
false
true
false
false
error_handling_problem
2
obvious
[]
[ { "finding_slug": "too-clever-8dd4b8a17782-l12-l18-dc498ed4", "flag": "too_clever", "start_line": 12, "end_line": 18, "excerpt": " visitBatch.parse(payload).reduce((departments, visit) => (", "explanation": "The reducer uses a comma expression to mutate the accumulator and then return i...
check-that-evaluatefeatureflag-correctly-returns-the-fallback-default-value-when-the-underlying-database-is-unreachable-ts-f9f63256f4e0
check-that-evaluatefeatureflag-correctly-returns-the-fallback-default-value-when-the-underlying-database-is-unreachable
feature-flags
test
Check that evaluateFeatureFlag correctly returns the fallback default value when the underlying database is unreachable.
ts
import { database } from '../database'; import { evaluateFeatureFlag } from '../evaluateFeatureFlag'; describe('evaluateFeatureFlag during a database outage', () => { // Restore the mocks after each test. afterEach(() => { jest.restoreAllMocks(); }); it('preserves an enabled fallback', async () => { /...
43
false
true
false
true
false
false
true
false
false
false
noise_comments
3
borderline
[ "duplicated_logic" ]
[ { "finding_slug": "noise-comments-f9f63256f4e0-l5-l5-7953c459", "flag": "noise_comments", "start_line": 5, "end_line": 5, "excerpt": " // Restore the mocks after each test.", "explanation": "Restates the afterEach restoreAllMocks call.", "audit_verdict": "valid" }, { "finding_sl...
calculate-the-volumetric-weight-surcharge-for-oversized-pallet-dimensions-using-standard-freight-conversion-ratios-ts-365bd00484b8
calculate-the-volumetric-weight-surcharge-for-oversized-pallet-dimensions-using-standard-freight-conversion-ratios
warehouse-operations
utility
Calculate the volumetric weight surcharge for oversized pallet dimensions using standard freight conversion ratios.
ts
import { z } from 'zod'; const palletSchema = z.object({ lengthCm: z.number().finite().positive().max(1000), widthCm: z.number().finite().positive().max(1000), heightCm: z.number().finite().positive().max(1000), actualWeightKg: z.number().finite().positive(), ratePerKg: z.number().finite().nonnegative().max(...
36
false
false
false
false
false
true
false
false
false
false
too_clever
3
obvious
[]
[ { "finding_slug": "too-clever-365bd00484b8-l20-l27-fba9be0b", "flag": "too_clever", "start_line": 20, "end_line": 27, "excerpt": " const assessment = dimensions.reduce(", "explanation": "The reducer uses comma operators to mutate volume and oversized and then return the accumulator, compr...
manage-the-active-signing-workflow-step-index-and-validate-whether-all-mandatory-fields-on-the-current-page-are-filled-out-ts-5c46d52a7f71
manage-the-active-signing-workflow-step-index-and-validate-whether-all-mandatory-fields-on-the-current-page-are-filled-out
document-signing
state-management
Manage the active signing workflow step index and validate whether all mandatory fields on the current page are filled out.
ts
import { makeAutoObservable } from 'mobx'; export type SigningField = { kind: 'text' | 'signature'; required: boolean; value: string }; export class SigningWorkflowStore { activeStepIndex = 0; constructor(public pages: SigningField[][]) { makeAutoObservable(this); } setStep(index: number): void { try { i...
27
false
false
false
false
false
false
false
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "error-handling-problem-5c46d52a7f71-l18-l20-5c41afe5", "flag": "error_handling_problem", "start_line": 18, "end_line": 20, "excerpt": "\t\t} catch {", "explanation": "The catch silently discards the RangeError raised for an invalid step and any other error in the try block...
accept-incoming-webhook-notifications-from-the-benefits-provider-and-update-employee-health-plan-enrollments-js-9b5fdda1ad25
accept-incoming-webhook-notifications-from-the-benefits-provider-and-update-employee-health-plan-enrollments
payroll
http-handler
Accept incoming webhook notifications from the benefits provider and update employee health plan enrollments.
js
import Joi from "joi"; import Boom from "@hapi/boom"; const notificationSchema = Joi.object({ employeeId: Joi.string().guid().required(), planId: Joi.string().pattern(/^[A-Z0-9-]{1,40}$/).required(), event: Joi.string().valid("enrolled", "terminated").required(), effectiveAt: Joi.string().isoDate().req...
38
false
false
false
false
false
true
false
false
false
false
too_clever
3
subtle
[]
[ { "finding_slug": "too-clever-9b5fdda1ad25-l20-l25-c5f95d91", "flag": "too_clever", "start_line": 20, "end_line": 25, "excerpt": " const parameters = Object.entries(notification).reduce((parameters, [field, value]) => (", "explanation": "This reducer combines field-to-position mapping...
calculate-estimated-reading-time-in-minutes-based-on-total-word-count-and-standard-reading-speeds-js-1c931cd6e92c
calculate-estimated-reading-time-in-minutes-based-on-total-word-count-and-standard-reading-speeds
content-publishing
utility
Calculate estimated reading time in minutes based on total word count and standard reading speeds.
js
import { has, isSafeInteger } from 'lodash'; const wordsPerMinuteBySpeed = Object.freeze({ slow: 200, standard: 250, fast: 300 }); export function estimateReadingTime(wordCount, speed = 'standard') { if (!isSafeInteger(wordCount)) { throw new TypeError('Word count must be a safe integer.'); ...
35
false
true
false
false
false
false
false
false
false
false
noise_comments
4
subtle
[]
[ { "finding_slug": "noise-comments-1c931cd6e92c-l33-l33-d365e4c5", "flag": "noise_comments", "start_line": 33, "end_line": 33, "excerpt": " // Round reading time up to a whole minute.", "explanation": "The comment merely restates Math.ceil(minutes) immediately below it; it does not explain...
process-attendee-registration-submissions-reserve-requested-seats-in-the-database-and-generate-invoice-records-ts-b39bd0c02862
process-attendee-registration-submissions-reserve-requested-seats-in-the-database-and-generate-invoice-records
event-ticketing
server-action
Process attendee registration submissions, reserve requested seats in the database, and generate invoice records.
ts
import { z } from 'zod'; import { TRPCError } from '@trpc/server'; import { db } from '@/server/db'; import { createTRPCRouter, protectedProcedure } from '@/server/api/trpc'; const registrationSchema = z.object({ eventId: z.string().uuid(), ticketTierId: z.string().uuid(), quantity: z.number().int().positive(), attend...
23
false
false
false
true
false
false
false
false
false
false
inconsistent_style
3
obvious
[]
[ { "finding_slug": "inconsistent-style-b39bd0c02862-l14-l14-5d54fa10", "flag": "inconsistent_style", "start_line": 14, "end_line": 14, "excerpt": " const capacity_update = await tx.ticketTier.updateMany({ where: { id: input.ticketTierId, eventId: input.eventId, availableCapacity: { gte...
implement-a-redux-slice-to-manage-active-dashboard-filters-date-ranges-and-pinned-metric-card-selections-locally-ts-84fed5b28bda
implement-a-redux-slice-to-manage-active-dashboard-filters-date-ranges-and-pinned-metric-card-selections-locally
analytics
state-management
Implement a Redux slice to manage active dashboard filters, date ranges, and pinned metric card selections locally.
ts
import { createSlice, PayloadAction } from '@reduxjs/toolkit' export interface DateRange { startDate: string endDate: string } export interface DashboardFiltersState { activeCategory: string dateRange: DateRange pinnedMetricIds: string[] } const initialState: DashboardFiltersState = { activeCategory: 'overview...
43
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]
fetch-all-pending-push-notifications-scheduled-for-dispatch-within-the-next-ten-minutes-from-the-delivery-queue-js-4bd34c2d8b6f
fetch-all-pending-push-notifications-scheduled-for-dispatch-within-the-next-ten-minutes-from-the-delivery-queue
notifications
database-access
Fetch all pending push notifications scheduled for dispatch within the next ten minutes from the delivery queue.
js
import { Op } from 'sequelize'; import { z } from 'zod'; import { DeliveryQueue } from '../models/delivery-queue.js'; const tenantIdSchema = z.union([z.string().min(1), z.number().finite()]); export function fetchPendingPushNotifications(tenantId) { return Promise.resolve().then(() => { const validatedTenantId ...
25
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
check-that-address-validation-rules-correctly-reject-incomplete-postal-codes-and-flag-restricted-destination-countries-js-d8b0f49103ab
check-that-address-validation-rules-correctly-reject-incomplete-postal-codes-and-flag-restricted-destination-countries
shipping
test
Check that address validation rules correctly reject incomplete postal codes and flag restricted destination countries
js
import request from "supertest"; import { app } from "../../src/app.js"; const rejectedDestinations = [ ["US", "San Francisco", "941", "postalCode", "INCOMPLETE_POSTAL_CODE"], ["CA", "Toronto", "M5V", "postalCode", "INCOMPLETE_POSTAL_CODE"], ["IR", "Tehran", "11369-17111", "country", "RESTRICTED_DESTINATIO...
15
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]
receive-incoming-webhook-payloads-from-external-calendar-providers-and-update-appointment-status-records-in-the-database-js-4b4ed9c9d1ba
receive-incoming-webhook-payloads-from-external-calendar-providers-and-update-appointment-status-records-in-the-database
scheduling
http-handler
Receive incoming webhook payloads from external calendar providers and update appointment status records in the database.
js
const { NextResponse } = require('next/server') const { verifyCalendarSignature } = require('@/lib/calendar-crypto') const { findAppointmentByExternalId, updateAppointmentStatus } = require('../../services/appointmentService') const STATUS_LABELS = ['confirmed', 'tentative', 'cancelled'] function formatAppointmentLog...
48
false
true
true
true
false
true
false
false
false
true
unsafe_input
2
obvious
[]
[ { "finding_slug": "dead-code-4b4ed9c9d1ba-l7-l9-1e1b7472", "flag": "dead_code", "start_line": 7, "end_line": 9, "excerpt": "function formatAppointmentLogMessage(appointmentId) {", "explanation": "The local helper is never called or exported.", "audit_verdict": "valid" }, { "findi...
sanitize-html-email-markup-by-stripping-dangerous-script-tags-and-malicious-attributes-js-e9b1450de260
sanitize-html-email-markup-by-stripping-dangerous-script-tags-and-malicious-attributes
email-campaigns
utility
Sanitize HTML email markup by stripping dangerous script tags and malicious attributes.
js
import sanitizeHtml from 'sanitize-html' import { uniq } from 'lodash-es' const campaignMarkupOptions = { allowedTags: uniq([...sanitizeHtml.defaults.allowedTags, 'img']), allowedAttributes: { a: ['href', 'title'], img: ['src', 'alt', 'width', 'height'], '*': ['class'] }, allowedSchemes: ['http', '...
29
false
false
false
false
true
false
false
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "over-abstracted-e9b1450de260-l15-l17-8790111c", "flag": "over_abstracted", "start_line": 15, "end_line": 17, "excerpt": "function campaignSanitizerAdapter(markup, options) {", "explanation": "This adapter only forwards its arguments to sanitizeHtml without adding behavior,...
normalize-raw-ldap-group-memberships-into-structured-permission-claims-for-the-downstream-token-generator-ts-504db1ecb75d
normalize-raw-ldap-group-memberships-into-structured-permission-claims-for-the-downstream-token-generator
permissions
data-transform
Normalize raw LDAP group memberships into structured permission claims for the downstream token generator.
ts
import { z } from "zod"; export interface PermissionClaim { scope: string; resource: string; } const membershipSchema = z.array(z.object({ dn: z.string().regex(/^cn=[^,]+/i), })); export function normalizeLdapMemberships(rawEntries: unknown): Promise<PermissionClaim[]> { return Promise.resolve() ...
34
false
false
false
false
false
false
false
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "error-handling-problem-504db1ecb75d-l30-l33-0c732ba5", "flag": "error_handling_problem", "start_line": 30, "end_line": 33, "excerpt": " .catch((error: unknown) => {", "explanation": "The catch handler logs normalization or validation failures and resolves to an empt...
map-raw-checkout-line-items-into-structured-payloads-required-by-the-external-tax-calculation-service-api-js-32c50609bc5c
map-raw-checkout-line-items-into-structured-payloads-required-by-the-external-tax-calculation-service-api
shopping-cart
data-transform
Map raw checkout line items into structured payloads required by the external tax calculation service API
js
import { z } from "zod" import { TaxProviderClient } from "@external/tax-service" const cartSchema = z.object({ customerId: z.string().min(1), currency: z.union([z.string().regex(/^[A-Z]{3}$/), z.literal("")]).nullish(), shippingAddress: z.object({ country: z.union([z.string().regex(/^[A-Z]{2}$/), z.literal(...
48
false
false
true
false
false
true
true
false
false
false
too_clever
3
borderline
[ "dead_code" ]
[ { "finding_slug": "dead-code-32c50609bc5c-l22-l22-1cd1010b", "flag": "dead_code", "start_line": 22, "end_line": 22, "excerpt": " cart.lineItems.forEach((item, lineIndex) => {", "explanation": "The callback parameter lineIndex is never used; remove it.", "audit_verdict": "valid" }, ...
accept-multipart-file-uploads-for-voice-notes-validate-audio-duration-limits-and-store-binaries-in-cloud-object-storage-js-bb986fcfc1a9
accept-multipart-file-uploads-for-voice-notes-validate-audio-duration-limits-and-store-binaries-in-cloud-object-storage
messaging
http-handler
Accept multipart file uploads for voice notes, validate audio duration limits, and store binaries in cloud object storage.
js
const { z } = require('zod'); const { File } = require('node:buffer'); const { randomUUID } = require('node:crypto'); const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3'); const c = new S3Client({}); const shape = z.object({ headers: z.record(z.string()), body: z.string().min(1).regex(/^(?:[A-Za-z0-9+/]...
29
true
false
false
false
false
false
false
false
false
false
unclear_naming
3
obvious
[]
[ { "finding_slug": "unclear-naming-bb986fcfc1a9-l5-l5-98c9fb3e", "flag": "unclear_naming", "start_line": 5, "end_line": 5, "excerpt": "const c = new S3Client({});", "explanation": "The single-letter name c does not identify the storage client, so use storage or s3Client.", "audit_verdict"...
calculate-the-weighted-average-score-across-all-published-ratings-and-group-them-by-month-for-trend-analysis-js-a592be703dad
calculate-the-weighted-average-score-across-all-published-ratings-and-group-them-by-month-for-trend-analysis
reviews
data-transform
Calculate the weighted average score across all published ratings and group them by month for trend analysis.
js
import { z } from "zod"; const ratingsSchema = z.array(z.object({ published: z.boolean(), score: z.number().finite().min(0).max(5), weight: z.number().finite().positive(), publishedAt: z.number().int().min(0).max(253402300799999) })); export function summarizeRatings(payload) { const published = ratingsSchema.pa...
35
false
false
false
false
false
false
true
false
false
false
duplicated_logic
3
subtle
[]
[ { "finding_slug": "duplicated-logic-a592be703dad-l26-l31-301b84bf", "flag": "duplicated_logic", "start_line": 26, "end_line": 31, "excerpt": "\t\tlet weightedSum = 0;", "explanation": "The monthly weighted-sum and total-weight accumulation repeats the initialization and loop at lines 12 thro...
query-postgresql-to-retrieve-all-active-subscriptions-where-the-next-renewal-date-falls-within-the-next-twenty-four-hours-ts-49eaa5ad0abf
query-postgresql-to-retrieve-all-active-subscriptions-where-the-next-renewal-date-falls-within-the-next-twenty-four-hours
subscription-billing
database-access
Query PostgreSQL to retrieve all active subscriptions where the next renewal date falls within the next twenty-four hours.
ts
import { Op } from 'sequelize'; import { SubscriptionModel } from '../models/subscription.model.js'; // Subscription repository module. export async function getSubscriptionsDueForRenewal(): Promise<SubscriptionModel[]> { // Set the length of the renewal window in milliseconds. const renewalWindowMs = 24 * 60 ...
31
false
true
false
true
false
false
false
false
false
false
noise_comments
3
obvious
[]
[ { "finding_slug": "noise-comments-49eaa5ad0abf-l4-l4-bda6326a", "flag": "noise_comments", "start_line": 4, "end_line": 4, "excerpt": "// Subscription repository module.", "explanation": "This banner merely labels the module without explaining a constraint or design decision.", "audit_ver...
render-a-seating-map-grid-that-highlights-currently-selected-vip-seats-and-disables-sold-out-zones-during-checkout-jsx-4ed63ae4b1cb
render-a-seating-map-grid-that-highlights-currently-selected-vip-seats-and-disables-sold-out-zones-during-checkout
event-ticketing
react-component
Render a seating map grid that highlights currently selected VIP seats and disables sold-out zones during checkout.
jsx
import { useState } from 'react'; import { Alert, Box, Button, Typography } from '@mui/material'; import { z } from 'zod'; const seatSchema = z.object({ id: z.string().min(1), label: z.string().min(1), vip: z.boolean() }); const checkout_schema = z.object({ zones: z.array(z.object({ id: z.strin...
47
false
false
false
true
false
false
false
false
false
false
inconsistent_style
3
obvious
[]
[ { "finding_slug": "inconsistent-style-4ed63ae4b1cb-l10-l10-0a16b2b3", "flag": "inconsistent_style", "start_line": 10, "end_line": 10, "excerpt": "const checkout_schema = z.object({", "explanation": "checkout_schema uses snake_case whereas the neighboring schema identifier seatSchema uses cam...
render-a-modal-confirmation-dialog-when-the-user-tries-to-delete-a-production-critical-feature-flag-definition-tsx-25b2e46119b1
render-a-modal-confirmation-dialog-when-the-user-tries-to-delete-a-production-critical-feature-flag-definition
feature-flags
react-component
Render a modal confirmation dialog when the user tries to delete a production-critical feature flag definition.
tsx
import { useState } from "react"; import { useMutation, useQuery } from "@tanstack/react-query"; import * as Dialog from "@radix-ui/react-dialog"; import { z } from "zod"; const flagSchema = z.object({ name: z.string().min(1), productionCritical: z.boolean() }); type Props = { flagId: string; onDeleted: () => void }; ...
49
false
true
false
true
false
false
false
false
false
false
noise_comments
3
obvious
[]
[ { "finding_slug": "noise-comments-25b2e46119b1-l10-l10-e1803817", "flag": "noise_comments", "start_line": 10, "end_line": 10, "excerpt": " // Store whether the confirmation is open.", "explanation": "Restates the immediately following confirmation state declaration.", "audit_verdict": "...
validate-that-attempting-to-access-forbidden-administrative-routes-returns-a-structured-403-error-js-551a9b2d50b8
validate-that-attempting-to-access-forbidden-administrative-routes-returns-a-structured-403-error
permissions
test
Validate that attempting to access forbidden administrative routes returns a structured 403 error.
js
import request from "supertest"; import { describe, it, expect, beforeEach } from "@jest/globals"; import { createApp } from "../src/app.js"; import { createSessionToken } from "../src/auth/session.js"; import { PermissionScope } from "../src/permissions/constants.js"; const forbiddenRoutes = [ { name: "us...
52
true
false
false
true
false
false
false
false
false
false
unclear_naming
3
subtle
[]
[ { "finding_slug": "unclear-naming-551a9b2d50b8-l25-l25-3a62352b", "flag": "unclear_naming", "start_line": 25, "end_line": 25, "excerpt": " let data;", "explanation": "The name data does not identify the authorization header value stored in this variable.", "audit_verdict": "valid" }...
execute-a-batch-archiving-command-that-moves-all-fully-paid-invoices-older-than-seven-years-into-cold-storage-js-4ab53262e9e3
execute-a-batch-archiving-command-that-moves-all-fully-paid-invoices-older-than-seven-years-into-cold-storage
invoicing
cli-script
Execute a batch archiving command that moves all fully paid invoices older than seven years into cold storage.
js
import { execFile } from 'node:child_process'; import { promisify } from 'node:util'; const execFileAsync = promisify(execFile); const archiveAuditCategory = 'invoice-retention'; function executeBatchArchiving() { const cutoffDate = new Date(); // Subtract seven years from the year. cutoffDate.setFullYear(cutof...
31
false
true
true
false
false
false
false
false
false
false
noise_comments
3
obvious
[]
[ { "finding_slug": "dead-code-4ab53262e9e3-l5-l5-97623b66", "flag": "dead_code", "start_line": 5, "end_line": 5, "excerpt": "const archiveAuditCategory = 'invoice-retention';", "explanation": "This local constant is never referenced or exported.", "audit_verdict": "valid" }, { "fi...
write-a-pure-helper-function-to-format-raw-millisecond-durations-into-human-readable-strings-for-performance-metric-tiles-ts-b1c483282b5e
write-a-pure-helper-function-to-format-raw-millisecond-durations-into-human-readable-strings-for-performance-metric-tiles
analytics
utility
Write a pure helper function to format raw millisecond durations into human readable strings for performance metric tiles.
ts
const DAY_IN_MILLISECONDS = 86_400_000; interface DurationPresentation { format(milliseconds: number): string; } class MetricTileDurationPresentation implements DurationPresentation { constructor(private readonly locale: string) {} format(milliseconds: number): string { if (milliseconds >= 60_000...
54
false
true
false
false
true
false
false
false
false
false
over_abstracted
3
obvious
[]
[ { "finding_slug": "over-abstracted-b1c483282b5e-l3-l5-91aebd76", "flag": "over_abstracted", "start_line": 3, "end_line": 5, "excerpt": "interface DurationPresentation {", "explanation": "This behavioral interface has exactly one implementation and no visible need for interchangeable presenta...
persist-guest-booking-progress-data-across-browser-sessions-using-local-storage-synchronization-ts-2beb7606d15c
persist-guest-booking-progress-data-across-browser-sessions-using-local-storage-synchronization
hotel-booking
react-hook
Persist guest booking progress data across browser sessions using local storage synchronization.
ts
import { useEffect, useState } from "react"; const storageKey = "hotel:booking-progress"; function validateProgress(value: string): string { if (!["rooms", "guests", "payment", "review"].includes(value)) { throw new Error("Unrecognized booking step"); } return value; } export function useBookingPro...
44
false
false
false
false
false
false
false
false
false
false
none
4
subtle
[]
[]
map-raw-chat-transcript-logs-into-an-aggregated-daily-metrics-report-showing-total-conversation-volume-and-average-agent-response-times-js-0590e713bb4d
map-raw-chat-transcript-logs-into-an-aggregated-daily-metrics-report-showing-total-conversation-volume-and-average-agent-response-times
customer-support
data-transform
Map raw chat transcript logs into an aggregated daily metrics report showing total conversation volume and average agent response times.
js
import _ from "lodash" import { z } from "zod" const transcriptSchema = z.object({ timestamp: z.string().datetime({ offset: true }), agentResponseTimeMs: z.number().finite().nonnegative().nullable().optional() }) const transcriptBatchSchema = z.array(transcriptSchema) const MILLISECONDS_PER_MINUTE = 60000 exp...
35
false
false
false
false
false
false
false
false
false
false
none
5
subtle
[]
[]
format-raw-integer-point-balances-into-localized-currency-equivalents-using-current-exchange-rates-ts-8015ba245055
format-raw-integer-point-balances-into-localized-currency-equivalents-using-current-exchange-rates
loyalty-rewards
utility
Format raw integer point balances into localized currency equivalents using current exchange rates.
ts
import { fetchCurrentExchangeRate } from "./exchangeRateClient"; export interface PointConversionOptions { currencyCode: string; locale: string; } export default async function formatPointsToCurrency(rawPointBalance: number, options: PointConversionOptions): Promise<string> { if (!Number.isSafeInteger(rawPointBala...
33
false
false
false
false
false
true
false
false
false
false
too_clever
3
obvious
[]
[ { "finding_slug": "too-clever-8015ba245055-l24-l32-403f18e3", "flag": "too_clever", "start_line": 24, "end_line": 32, "excerpt": "\treturn [rawPointBalance / 100, exchangeRate].reduce<{ amount: number; label: string }>(", "explanation": "This reduction combines multiplication, overflow valid...
assert-that-filtering-rental-listings-by-maximum-nightly-rate-correctly-omits-properties-above-the-threshold-ts-62dabdac1155
assert-that-filtering-rental-listings-by-maximum-nightly-rate-correctly-omits-properties-above-the-threshold
property-listings
test
Assert that filtering rental listings by maximum nightly rate correctly omits properties above the threshold.
ts
import request from 'supertest'; import { z } from 'zod'; import { createRentalTestApp } from './support/rental-app.js'; it('omits rentals above the maximum nightly rate and includes the boundary', async () => { const app = await createRentalTestApp({ listings: [ { id: 'canal-loft', nightlyRate: 90 }, { id: ...
22
false
true
false
false
false
false
false
false
false
false
noise_comments
4
subtle
[]
[ { "finding_slug": "noise-comments-62dabdac1155-l11-l11-3b766612", "flag": "noise_comments", "start_line": 11, "end_line": 11, "excerpt": " // Fetch rentals within the nightly budget, cheapest first.", "explanation": "The comment merely paraphrases the immediately following GET, maximum-rate...
handle-the-course-creation-mutation-by-validating-instructor-credentials-storing-metadata-and-redirecting-users-ts-2e93c668f0bf
handle-the-course-creation-mutation-by-validating-instructor-credentials-storing-metadata-and-redirecting-users
course-management
server-action
Handle the course creation mutation by validating instructor credentials, storing metadata, and redirecting users.
ts
import { TRPCError } from '@trpc/server'; import { z } from 'zod'; import { redirect } from 'next/navigation'; import { db } from '../../lib/db'; import { router, protectedProcedure } from '../trpc'; // Define the course creation input schema. const createCourseInputSchema = z.object({ // Validate the course title l...
63
false
true
false
false
false
false
false
true
false
false
error_handling_problem
2
obvious
[]
[ { "finding_slug": "noise-comments-2e93c668f0bf-l7-l7-5ae15f89", "flag": "noise_comments", "start_line": 7, "end_line": 7, "excerpt": "// Define the course creation input schema.", "explanation": "Restates the immediately following schema declaration.", "audit_verdict": "valid" }, { ...
purge-all-historical-notification-delivery-logs-older-than-ninety-days-from-the-audit-archive-table-js-f367460da74c
purge-all-historical-notification-delivery-logs-older-than-ninety-days-from-the-audit-archive-table
notifications
cli-script
Purge all historical notification delivery logs older than ninety days from the audit archive table.
js
const readline = require("node:readline"); exports.purgeArchive = function (db, input = process.stdin, output = process.stdout, now = Date.now()) { const cutoff = new Date(now - 90 * 24 * 60 * 60 * 1000).toISOString(); const prompt = readline.createInterface({ input, output }); return new Promise((resolve, rejec...
24
false
false
false
false
false
false
true
false
false
true
unsafe_input
1
obvious
[]
[ { "finding_slug": "duplicated-logic-f367460da74c-l11-l20-1670fefa", "flag": "duplicated_logic", "start_line": 11, "end_line": 20, "excerpt": " if (schema === \"\") {", "explanation": "Both branches execute the same deletion with the same cutoff and differ only in the schema, so defaulting...
check-that-unauthorized-api-access-attempts-correctly-generate-corresponding-high-severity-threat-audit-entries-ts-4c750f41cfe6
check-that-unauthorized-api-access-attempts-correctly-generate-corresponding-high-severity-threat-audit-entries
audit-logging
test
Check that unauthorized API access attempts correctly generate corresponding high-severity threat audit entries.
ts
import { readSecuritySettings } from '../api/security-settings'; import { appendThreatEntry } from '../audit/store'; jest.mock('../audit/store', () => ({ appendThreatEntry: jest.fn() })); const appendEntry = appendThreatEntry as jest.Mock; const occurredAt = '2025-02-14T09:30:00.000Z'; beforeEach(() => { jest.useF...
26
false
false
false
false
false
true
false
false
true
false
too_clever
2
obvious
[]
[ { "finding_slug": "type-safety-hole-4c750f41cfe6-l5-l5-d717d535", "flag": "type_safety_hole", "start_line": 5, "end_line": 5, "excerpt": "const appendEntry = appendThreatEntry as jest.Mock;", "explanation": "Casting to the broad jest.Mock type discards the imported function's argument and re...
process-form-submissions-for-new-real-estate-listings-validate-pricing-inputs-and-persist-records-ts-bfdb1507bb9c
process-form-submissions-for-new-real-estate-listings-validate-pricing-inputs-and-persist-records
property-listings
server-action
Process form submissions for new real estate listings, validate pricing inputs, and persist records.
ts
import { json, redirect, type ActionFunctionArgs } from '@remix-run/node'; import { db } from '~/db.server'; import { requireUserId } from '~/auth.server'; export async function action({ request }: ActionFunctionArgs) { const ownerId = await requireUserId(request); const form = await request.formData(); const ti...
58
false
false
false
false
false
false
true
false
false
false
duplicated_logic
4
subtle
[]
[ { "finding_slug": "duplicated-logic-bfdb1507bb9c-l22-l42-f4fe6909", "flag": "duplicated_logic", "start_line": 22, "end_line": 42, "excerpt": " let priceCents: number | null = null;", "explanation": "Price and deposit repeat the same string narrowing, trimming, decimal validation, cents conv...
process-a-supervisor-approval-submission-for-a-travel-report-update-its-status-to-cleared-and-trigger-a-notification-email-js-a2347d457b9b
process-a-supervisor-approval-submission-for-a-travel-report-update-its-status-to-cleared-and-trigger-a-notification-email
expense-reports
server-action
Process a supervisor approval submission for a travel report, update its status to cleared, and trigger a notification email.
js
'use server'; import { z } from 'zod'; import { db } from '@/server/db'; import { requireSupervisor } from '@/server/auth'; import { sendTravelReportCleared } from '@/server/mail'; const approvalSchema = z.object({ reportId: z.string().uuid(), }).passthrough(); export function approveTravelReport(submission) { r...
60
false
false
false
false
false
false
false
false
false
true
unsafe_input
2
subtle
[]
[ { "finding_slug": "unsafe-input-a2347d457b9b-l16-l18-7cdbfd33", "flag": "unsafe_input", "start_line": 16, "end_line": 18, "excerpt": " const approvalNote = typeof approval.approvalNote === 'string'", "explanation": "The schema validates only reportId and passes other fields through, so ...
build-a-command-line-maintenance-script-to-purge-raw-event-logs-older-than-ninety-days-from-the-analytics-partition-store-js-454cde37f711
build-a-command-line-maintenance-script-to-purge-raw-event-logs-older-than-ninety-days-from-the-analytics-partition-store
analytics
cli-script
Build a command-line maintenance script to purge raw event logs older than ninety days from the analytics partition store.
js
const { Command } = require('commander'); const { Client } = require('pg'); const { z } = require('zod'); const deletionSchema = z.array(z.object({ deleted: z.string().regex(/^(0|[1-9][0-9]*)$/), })).length(1); async function main() { const command = new Command() .name('purge-raw-events') .description('Purge a...
41
false
false
false
false
false
true
false
false
false
true
too_clever
3
obvious
[]
[ { "finding_slug": "unsafe-input-454cde37f711-l15-l15-887dcd73", "flag": "unsafe_input", "start_line": 15, "end_line": 15, "excerpt": "\tconst client = new Client({ connectionString: command.opts().database });", "explanation": "The CLI/environment database setting is used as a connection str...
define-typescript-interfaces-representing-a-multi-currency-refund-request-payload-and-corresponding-api-response-ts-322496e8684a
define-typescript-interfaces-representing-a-multi-currency-refund-request-payload-and-corresponding-api-response
payments
type-definitions
Define TypeScript interfaces representing a multi-currency refund request payload and corresponding API response.
ts
export type Currency = "USD" | "EUR" | "GBP"; export type RefundStatus = "pending" | "succeeded" | "failed"; export interface Money { currency: Currency; minorUnits: number; } function refundAmounts(amounts?: Money[]): Money[] { if (amounts === undefined) { amounts = []; } return amounts!; } type Refun...
43
false
false
false
false
true
true
true
false
true
false
over_abstracted
2
borderline
[ "type_safety_hole" ]
[ { "finding_slug": "over-abstracted-322496e8684a-l9-l27-dff70005", "flag": "over_abstracted", "start_line": 9, "end_line": 27, "excerpt": "function refundAmounts(amounts?: Money[]): Money[] {", "explanation": "A runtime helper referenced for its return type, a conditional generic, and mapped ...
bind-click-listeners-on-property-card-thumbnail-buttons-to-cycle-through-active-photo-carousel-indexes-ts-e741edc5f2a5
bind-click-listeners-on-property-card-thumbnail-buttons-to-cycle-through-active-photo-carousel-indexes
property-listings
dom-code
Bind click listeners on property card thumbnail buttons to cycle through active photo carousel indexes.
ts
import { z } from "zod"; const carouselResponse = z.object({ currentPhotoUrl: z.string().url().regex(/^https?:\/\//) }); export async function initializePhotoCarousels(containerElement: HTMLElement): Promise<void> { for (const element of containerElement.querySelectorAll(".property-thumbnail-btn")) { if (!(elem...
40
false
false
true
false
false
false
true
false
false
false
duplicated_logic
3
borderline
[ "type_safety_hole" ]
[ { "finding_slug": "dead-code-e741edc5f2a5-l20-l20-5799d4e0", "flag": "dead_code", "start_line": 20, "end_line": 20, "excerpt": " const previousIndex = image.dataset.currentIndex;", "explanation": "previousIndex is never read, so remove the unused snapshot.", "audit_verdict": "vali...
render-a-weekly-calendar-grid-displaying-meeting-time-slots-with-hover-tooltips-showing-participant-email-addresses-tsx-47015fb5b6c3
render-a-weekly-calendar-grid-displaying-meeting-time-slots-with-hover-tooltips-showing-participant-email-addresses
scheduling
react-component
Render a weekly calendar grid displaying meeting time slots with hover tooltips showing participant email addresses.
tsx
import { useState } from "react"; import styled from "styled-components"; interface MeetingSlot { id: string; dayOfWeek: number; startHour: number; endHour: number; participantEmails: string[]; } const Grid = styled.div` display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repe...
65
false
false
false
false
false
true
false
true
true
false
error_handling_problem
2
obvious
[]
[ { "finding_slug": "type-safety-hole-47015fb5b6c3-l39-l39-fb2ab88d", "flag": "type_safety_hole", "start_line": 39, "end_line": 39, "excerpt": "\tconst [activeSlot, setActiveSlot] = useState<any>(null);", "explanation": "The explicit any disables checking of hovered-slot state and its setter e...
aggregate-monthly-transaction-ledgers-into-tiered-loyalty-earnings-summaries-grouped-by-reward-category-js-9cb8c304982e
aggregate-monthly-transaction-ledgers-into-tiered-loyalty-earnings-summaries-grouped-by-reward-category
loyalty-rewards
data-transform
Aggregate monthly transaction ledgers into tiered loyalty earnings summaries grouped by reward category.
js
import { addMonths, format, isValid, parseISO } from "date-fns"; export function summarizeMonthlyRewards(ledger, month, tier) { if (typeof month !== "string" || !/^\d{4}-\d{2}$/.test(month)) { throw new TypeError("Month must use YYYY-MM"); } const start = parseISO(`${month}-01`); if (!isValid(s...
57
false
false
false
false
false
true
false
false
false
false
too_clever
3
obvious
[]
[ { "finding_slug": "too-clever-9cb8c304982e-l37-l53-50dbf388", "flag": "too_clever", "start_line": 37, "end_line": 53, "excerpt": " const categories = transactions.reduce((groups, entry) => (", "explanation": "The reducer combines filtering, group creation and mutation through short-circui...
group-completed-deals-by-sales-representative-and-calculate-total-monthly-revenue-generated-ts-1ae46b9786e4
group-completed-deals-by-sales-representative-and-calculate-total-monthly-revenue-generated
crm
data-transform
Group completed deals by sales representative and calculate total monthly revenue generated.
ts
import _ from "lodash" import { z } from "zod" const dealsSchema = z.array(z.object({ salesRepId: z.string().min(1), status: z.enum(["pending", "completed", "lost"]), revenue: z.number().finite().nonnegative(), completedAt: z.string().datetime().nullable() }).refine(deal => deal.status !== "completed" ...
41
false
true
false
false
false
false
true
false
false
false
duplicated_logic
3
subtle
[]
[ { "finding_slug": "noise-comments-1ae46b9786e4-l23-l23-1e3429dd", "flag": "noise_comments", "start_line": 23, "end_line": 23, "excerpt": " // Summarize completed sales for each representative", "explanation": "This repeats the purpose already expressed by the function name and the complet...
fetch-all-fulfillment-records-joined-with-shipment-tracking-numbers-for-a-given-customer-identifier-sorted-by-dispatch-date-ts-8bba5f7f63b8
fetch-all-fulfillment-records-joined-with-shipment-tracking-numbers-for-a-given-customer-identifier-sorted-by-dispatch-date
order-management
database-access
Fetch all fulfillment records joined with shipment tracking numbers for a given customer identifier sorted by dispatch date
ts
import { Repository } from "typeorm"; import { FulfillmentRecord } from "../entity/FulfillmentRecord"; export class FulfillmentRepository { constructor(private readonly repository: Repository<FulfillmentRecord>) {} public async findShipmentsByCustomerIdentifier(customerIdentifier: string): Promise<FulfillmentRecord...
22
false
false
true
false
false
false
false
true
false
false
error_handling_problem
2
subtle
[]
[ { "finding_slug": "dead-code-8bba5f7f63b8-l18-l18-a002955d", "flag": "dead_code", "start_line": 18, "end_line": 18, "excerpt": "\t\t} catch (queryError) {", "explanation": "The catch binding queryError is unused.", "audit_verdict": "valid" }, { "finding_slug": "error-handling-pro...
check-that-signing-requests-expire-precisely-twenty-four-hours-after-creation-when-no-manual-extension-is-triggered-by-the-sender-ts-8e66a75faef3
check-that-signing-requests-expire-precisely-twenty-four-hours-after-creation-when-no-manual-extension-is-triggered-by-the-sender
document-signing
test
Check that signing requests expire precisely twenty-four hours after creation when no manual extension is triggered by the sender.
ts
import request from 'supertest'; import { z } from 'zod'; import { app } from '../src/app.js'; import { SigningRequestModel } from '../src/models/SigningRequest.js'; const statusResponse = z.object({ status: z.enum(['PENDING', 'EXPIRED']) }); async function fetchSigningStatus(endpoint: string, requestLabel: string) {...
45
false
false
true
false
true
false
false
false
false
false
over_abstracted
3
subtle
[]
[ { "finding_slug": "dead-code-8e66a75faef3-l8-l8-f85cc5f1", "flag": "dead_code", "start_line": 8, "end_line": 8, "excerpt": "async function fetchSigningStatus(endpoint: string, requestLabel: string) {", "explanation": "The requestLabel parameter is never read and its supplied label has no eff...
render-a-detailed-view-panel-showing-the-exact-json-payload-diff-for-an-updated-user-permission-audit-log-entry-tsx-b36ff350b9fa
render-a-detailed-view-panel-showing-the-exact-json-payload-diff-for-an-updated-user-permission-audit-log-entry
audit-logging
react-component
Render a detailed view panel showing the exact JSON payload diff for an updated user permission audit log entry.
tsx
import styled from 'styled-components' import { z } from 'zod' const Panel = styled.section` padding: 24px; background: #1a1a1a; color: #f5f5f5; font-family: monospace; ` const Payload = styled.pre` background: #111; padding: 16px; border-radius: 4px; overflow-x: auto; ` const shape = z...
43
true
true
true
true
false
false
false
false
false
false
inconsistent_style
3
obvious
[]
[ { "finding_slug": "dead-code-b36ff350b9fa-l22-l22-23e28573", "flag": "dead_code", "start_line": 22, "end_line": 22, "excerpt": "const compactSpacing = 0", "explanation": "This local constant is never referenced.", "audit_verdict": "valid" }, { "finding_slug": "noise-comments-b36f...
define-typescript-interfaces-representing-physical-warehouse-locations-bin-zones-and-shelf-capacities-ts-070112d9097a
define-typescript-interfaces-representing-physical-warehouse-locations-bin-zones-and-shelf-capacities
inventory
type-definitions
Define TypeScript interfaces representing physical warehouse locations, bin zones, and shelf capacities.
ts
import { z } from 'zod'; export const ZoneTypeSchema = z.enum([ 'RECEIVING', 'STORAGE', 'PICKING', 'PACKING', 'SHIPPING', 'QUARANTINE' ]); export type ZoneType = z.infer<typeof ZoneTypeSchema>; export const ShelfCapacitySchema = z.object({ maxWeightKg: z.number().positive(), maxVolumeM3: z.number().p...
46
false
false
false
false
false
false
false
false
false
false
none
5
obvious
[]
[]