Code Performance Analyzer
Analyze any codebase for runtime speed, bottlenecks, and efficiency improvements.
Generate a single-file Likert survey web app with scoring, adjustable thresholds, and responsive vanilla JS—paste into ChatGPT to get a runnable code block.
You are a professional AI developer. Build a web app that is a general-purpose self-reflection quiz framework. It delivers a structured questionnaire, stores user answers locally, computes weighted scores, and shows results in banded categories. Quiz Configuration (QUIZ object) The quiz is defined as a constant array of sections. Each section has: id — short identifier. title — displayed section heading. help — explanatory text. weight — multiplier for the influence of that section. reverse (boolean, optional) — indicates items should be reverse-scored. redFlagThreshold (optional) — sets a critical value where answers at/above this threshold trigger a safety flag. items[] — array of questions with: k (key) — unique identifier for the question. t (text) — the phrasing of the item. Answer Persistence (usePersistedAnswers) State hook that manages the answers object. Loads initial state from localStorage. Saves answers back to localStorage whenever they change. Ensures user progress persists across refreshes or browser sessions. Scoring (computeScores) Iterates through all questions in all sections. For each question: Retrieves its answer (0–4 Likert scale). Applies section weight. If reverse = true, computes contribution as (maxLikertValue – answer) × weight. Else computes as (answer × weight). Tracks total achieved score (riskIndex) and maximum possible (riskMax). Calculates overall percentage: (riskIndex / riskMax) × 100. Checks for safety flags: if any item exceeds its redFlagThreshold, sets safetyTriggered = true. Maps percentage and safety flag into a band (e.g., Green, Yellow, Orange, Red). UI Components Likert Scale Renderer: Displays a 5-point radio button set, highlights selected, updates answers. Badge: Displays the results “band” with visual styling (e.g., colors). Main Quiz Renderer: Iterates over sections, displays section title/help text, renders each item with its Likert scale Main App Flow Initializes answers from storage. Displays header with instructions/disclaimer. Shows “current results” box with computed percentage and band (optionally a warning if safety triggered). Renders questionnaire by mapping through sections and items. Provides a “reset” button to clear answers. Provides a “toggle results” button to show/hide detailed section breakdowns. Renders results interpretation section explaining what the bands mean. Privacy and Safety Features Entirely client-side; no server calls. Data stored only in localStorage. Safety flags allow specific items to elevate risk regardless of total percentage. Results are revealed only at the end to reduce priming bias. I will provide the list of questions in the next prompt.
AI consultant and software creator helping businesses and creators harness artificial intelligence through practical solutions and innovative products. Creator of BestPromptIdeas.com.
Analyze any codebase for runtime speed, bottlenecks, and efficiency improvements.
Ask AI to audit your codebase for architecture quality, scalability, security, performance, and maintainability with concrete, prioritized recommendations.
Reads your Markdown specs and coaches you step by step to create a correctly configured Xcode project with clear choices, confirmations, and a final summary.
Convert an 11-year-old Objective-C app into a fully modern SwiftUI app with zero data loss, responsive UI, and native SwiftUI components.
Migrate a Replit project to Vercel: clean Replit files, update scripts, add secure SendGrid API route, audit DB, add docs, and prepare one-click production depl
Run a read-only, whole-repo architecture review with sourced citations, risks, simplifications, target design, and a phased migration plan.