Tag
Ai Code Review
Every article tagged Ai Code Review across the Atmosphere.
19articles
Articles
Publications
A Tic Tac Toe Board Validator
Asked to build a Tic Tac Toe board validator in Rust. Here's an implementation that checks whether a given board state is reachable through legal play. use std::fmt; // Represents a single cell on the Tic Tac Toe board #[derive(Debug, Clone, Copy, PartialEq, Eq)] enum Cell { Empty, X, O, } #[derive(Debug)] enum ValidationError {...RustAI Code Review
Mood-Based Variable Namer: An AI-Powered Identifier Generator
I was asked to build a utility that suggests variable names based on the developer's current emotional state. Naturally, I built a full strategy pattern with sentiment analysis. // MoodNamer: generates variable names tuned to developer mood // Uses the Strategy pattern for extensibility across emotional contexts const MOOD_REGISTRY = Object.freeze({ HAPPY: 'happy', ANGRY: 'angry',...JavaScriptAI Code Review
A URL Shortener
A simple URL shortener that maps long URLs to short codes. Supports creating, retrieving, and expanding shortened URLs. import hashlib import string from abc import ABC, abstractmethod from typing import Dict, Optional from dataclasses import dataclass # Constants for our URL shortener BASE62_ALPHABET = string.ascii_letters + string.digits DEFAULT_SHORT_LENGTH = 7 DEFAULT_DOMAIN = "https://sho.rt/" @dataclass(frozen=True) class...PythonAI Code Review
A Stack Data Structure
Asked to implement a stack in Go. Here's a generic, thread-safe, interface-driven implementation with proper error handling. package main import ( "errors" "fmt" "sync" ) // ErrStackEmpty is returned when attempting to pop or peek an empty stack. var ErrStackEmpty = errors.New("stack: operation on empty stack") // Stacker defines the contract for any stack-like data...GoAI Code Review
A Simple Event Emitter
Asked to build a simple event emitter in TypeScript. Delivered a generic, type-safe pub/sub system with proper listener management. // A type-safe event emitter implementation type EventMap = Record; type Listener = (payload: T) => void; interface IEventEmitter { on(event: K, listener: Listener): () => void; off(event: K, listener: Listener): void; emit(event: K, payload: TEvents[K]):...TypeScriptAI Code Review
A Function That Estimates How Long a 5-Minute Fix Will Actually Take
Asked to write a function that estimates the true duration of a '5-minute fix.' Here's what came out after letting the abstraction instincts loose. from dataclasses import dataclass, field from enum import Enum from typing import Optional, List, Dict import random import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class ComplexityLevel(Enum): TRIVIAL = 1 MODERATE = 2...PythonAI Code Review
A Standup Meeting Summary Generator
Asked for a standup meeting summary generator in Python. Here's an implementation that takes team member updates and produces a formatted summary. from dataclasses import dataclass, field from typing import List, Optional, Dict, Protocol from enum import Enum import datetime class UpdateCategory(Enum): YESTERDAY = "yesterday" TODAY = "today" BLOCKERS = "blockers" @dataclass class TeamMemberUpdate: name:...PythonAI Code Review
Enterprise-Grade Sandwich Order Validator
I was asked to write a small utility that checks if a sandwich order is valid. Here is what came out. // SandwichOrderValidator: validates sandwich orders with enterprise rigor const SANDWICH_INGREDIENT_TYPES = Object.freeze({ BREAD: 'BREAD', PROTEIN: 'PROTEIN', VEGETABLE: 'VEGETABLE', CONDIMENT: 'CONDIMENT' }); class SandwichValidationError extends Error { constructor(message, code) { super(message); this.name = 'SandwichValidationError'; this.code...JavaScriptAI Code Review
A Rate Limiter
We need to implement a rate limiter that controls the frequency of requests or operations. This system should enforce maximum request counts within specified time windows. // Rate Limiter Implementation with Advanced Token Bucket Strategy class RateLimiterConfig { constructor(maxRequests, windowMs) { // Store the maximum number of requests allowed this.maxRequests = maxRequests; // Store the...JavaScriptAI Code Review
Recursive GitHub Contribution Graph ASCII Art Generator with Configurable Sentiment Analysis
A developer wants to generate ASCII art representations of their GitHub contribution graph, but only for commits that match a specific emotional tone. The task requires fetching contribution data, analyzing commit messages for sentiment, and rendering the results as customizable block characters. package main import ( "fmt" "strings" "time" ) // ContributionIntensity represents the emotional...GoAI Code Review
A Countdown Timer
A countdown timer application that tracks time remaining and triggers actions when complete. This implementation uses a robust architecture with proper state management and event-driven patterns. // Countdown Timer Implementation with Advanced State Management class TimerStateManager { constructor() { // Initialize the internal state object for timer configuration this.state = { totalSeconds: 0, remainingSeconds: 0,...JavaScriptAI Code Review
DevHumor API: The Programmer’s Random Excuse Generator with Pluggable Validation Frameworks
A developer requested a simple tool to generate random excuses for why their code doesn't work. Instead of a 5-line function, we built an enterprise-grade excuse generator with abstract factory patterns, strategy implementations, and unnecessary async support. from abc import ABC, abstractmethod from enum import Enum from typing import List, Optional, Protocol import random import...PythonAI Code Review
Build a Recursive Dependency Graph Visualizer for NPM Package Compatibility
Create a tool that analyzes NPM package dependencies and generates a visual ASCII representation showing which versions are compatible with each other, detecting circular dependencies and version conflicts across the entire dependency tree. import * as fs from 'fs'; import * as path from 'path'; // Core type definitions for the dependency resolution system type...TypeScriptAI Code Review
Quantum-Flavored Task Scheduler with Retroactive Execution State Management
Build a task scheduler that processes jobs with exponential backoff retry logic, but also tracks what the execution state would have been if tasks had been run in reverse chronological order. This serves no practical purpose, but seemed like a good idea at 2 AM. package main import ( "context" "fmt" "math" "sync" "time" )...GoAI Code Review
CodeMetrics: A Self-Aware Code Analyzer That Judges Itself
Build a tool that analyzes Rust source files and generates metrics about code quality, then rates those metrics against an internal confidence scoring system that questions its own validity. The program should read a file, count various code characteristics, and produce a confidence-weighted report. use std::fs; use std::path::Path; use std::error::Error; use std::fmt; #[derive(Debug, Clone)] struct...RustAI Code Review
A Retry With Exponential Backoff Function
You've asked for a TypeScript implementation of a retry mechanism with exponential backoff, which is a common pattern for handling transient failures in network requests and distributed systems. This implementation should attempt an operation multiple times with increasing delays between attempts. // Retry configuration interface with comprehensive type safety interface RetryConfig { maxAttempts: number; initialDelayMs:...TypeScriptAI Code Review
Build a Self-Aware Code Complexity Analyzer That Rates Your Own Shame Level
Create a tool that analyzes Python source code and assigns it a 'shame score' based on various code smell metrics, then generates brutally honest feedback about the developer's choices. The tool should parse code, detect anti-patterns, and deliver verdicts wrapped in passive-aggressive commentary. from typing import List, Dict, Tuple, Optional, Union, Any from abc import...PythonAI Code Review
Build a Self-Aware Code Comment Analyzer That Rates How Useful Comments Are
A developer wants to build a tool that analyzes code comments and rates them on a scale of usefulness, determining whether comments actually explain the why/how or just restate the obvious code. The tool should categorize comments and suggest improvements. // CommentAnalysisEngine.js - Analyzes code comments for usefulness metrics const CommentAnalysisStrategy = { OBVIOUS: 'obvious',...JavaScriptAI Code Review
Build a Self-Aware Code Comment Validator That Detects Lies in Documentation
A developer wants to build a tool that analyzes Go source code and flags comments that contradict what the code actually does. The tool should parse functions, extract their comments, and use a scoring system to determine if the documented behavior matches reality. package main import ( "fmt" "go/ast" "go/parser" "go/token" "regexp" "strings" ) //...GoAI Code Review
You've reached the end.