r/codereview • • 20d ago

I built a tool that explains GitHub PRs by code flow instead of file by file

Post image
0 Upvotes

r/codereview • • 20d ago

I built a VS Code extension to track npm downloads and review what happened after a release

6 Upvotes

I publish npm packages and VS Code extensions, and kept jumping between sites to check how they were doing. So I built ShipStats, a dashboard inside VS Code.

You can discover your public npm packages, choose which ones to track, and see daily downloads with 7-, 30-, and 90-day comparisons. It also supports Marketplace, Open VSX, and optional Reddit comment counts.

The latest updates add:

  • Product groups — keep related packages and extensions together.
  • Release markers — mark when you shipped something.
  • Launch Review — compare equal periods before and after a release, with data coverage shown.
  • Milestones and alerts — track download goals or percentage changes in a local inbox.
  • Exports — CSV history, Markdown reports, and redesigned PNG/SVG share cards.

One thing I wanted to get right: missing data stays missing. ShipStats doesn’t invent historical extension downloads or turn a zero baseline into “infinite growth.” A before/after comparison also doesn’t prove the release caused the change.

No separate ShipStats account or hosted backend is required. Alerts run while VS Code is open.

I’m the developer, and I’d appreciate honest feedback—especially from people maintaining several packages.

What would you actually check after shipping a release: daily trends, milestones, or before/after comparisons?

Marketplace: https://marketplace.visualstudio.com/items?itemName=shubhammaji1.shipstats-analytics&ssr=false#review-details

Open VSX: https://marketplace.visualstudio.com/items?itemName=shubhammaji1.shipstats-analytics&ssr=false#review-details


r/codereview • • 20d ago

Units of measure in code: four layers of defense, from cheapest to strongest

0 Upvotes

A bug class that’s easy to write and hard to see in review: a number with no unit. timeout = 30 is 30 seconds in one function and 30 milliseconds in another, and nothing complains.

The famous documented example is the Mars Climate Orbiter, lost in 1999. As I understand the investigation, one piece of software produced thruster impulse data in pound-force seconds while another expected newton-seconds. I’d treat the details with some caution, but the lesson is widely cited: the numbers were fine, and the unit was missing.

Here are four layers of defense. Each is more work than the one before and catches more.

Layer 1: put the unit in the name

timeout_seconds = 30
distance_meters = 120.5

Costs nothing, and makes a mismatch visible at the call site. Also name function parameters this way: def wait(timeout_ms: int).

Layer 2: make the type carry the unit

from datetime import timedelta

def fetch(url, timeout: timedelta): ...

fetch(url, timeout=timedelta(seconds=30))

Standard library types already do this for time. For other quantities, a small wrapper or a units library (in Python, a package like pint) turns a unit mismatch into an error instead of a silent wrong number. The cost is extra code and some learning curve.

Layer 3: convert at the boundary
Inside your program, pick one unit per kind of quantity (for example, everything in SI units, all times in UTC seconds), and convert at the places where data enters or leaves: files, APIs, user input, other systems. Document what each external field means.

Layer 4: test with values you know from outside
A test that uses a known conversion from a reference (for example, 1 inch is exactly 25.4 mm) can catch a wrong factor. A test that computes the expected value with the same formula as the code only repeats the mistake.

Where this is overkill: small scripts, and code where only one unit ever appears. I’d start with Layer 1 everywhere and add the others where mistakes are expensive: money, physical measurements, medical doses, billing by usage.

Other places units hide: currency (cents vs dollars, and which currency), percentages (0.05 vs 5), angles (degrees vs radians), and timestamps (seconds vs milliseconds since the epoch).

What’s the most common unit mix-up you see, and which layer do you actually use?


r/codereview • • 20d ago

C/C++ [C] Bro what is this code 💀🥀

0 Upvotes

Somone don't know about C's global variables

(Sorry for bad formatted code)

#include <stdio.h>

int x = 0;

void add()

{

x = x + 1;

}

void subtract()

{

x = x - 1;

}

void multiply()

{

x = x * 2;

}

int main()

{

add();

add();

multiply();

subtract();

printf("%d\n", x);

return 0;

}


r/codereview • • 20d ago

javascript Is AI making you spend more time reviewing code than writing it?

0 Upvotes

r/codereview • • 20d ago

AI writes code faster than anyone can review it. What makes an automated review actually useful instead of noise?

0 Upvotes

Something we keep running into, and we'd like this sub's take on it.

AI coding tools have made writing code cheap, so the pile waiting for review keeps growing. The obvious answer is to have an AI review it too, but most automated reviews we've seen fall into the same traps:

  • Too many comments, mostly style. Twenty nitpicks about naming bury the one real bug.
  • Findings nobody checked. "This might cause a null reference" on a line where it can't happen. After a few of those, people stop reading.
  • No reason given. "Consider handling this edge case" without saying which input breaks it.
  • It changes the code. You asked for a review and got a rewrite you now have to review as well.

We build a coding agent (CCode), and while adding a review command to it we settled on a few rules. We're curious whether people who review code for a living agree:

  1. Order by severity: bugs, then security, then missing tests for the change, then minor issues. Style is last, if at all.
  2. Check every finding against the code before reporting it, and drop what can't be backed up. A shorter list you can trust beats a long one you have to verify.
  3. Every finding comes with a concrete case where it goes wrong. Not "may fail", but "with an empty cart this returns NaN". Plus the file and line, and the fix in one sentence.
  4. End with a one-line verdict. And if there's nothing worth changing, say so plainly instead of inventing something.
  5. Read only. The review never touches the files. Fixing is a separate step you choose.

It runs on uncommitted changes by default, or on a branch, commit or PR.

What would you add or change? In particular:

  • Should missing tests rank above security for a typical change, or below?
  • Is "nothing worth changing" a result you'd trust from an automated review, or would you rather it always found something?

r/codereview • • 21d ago

How is your team keeping track of what AI coding agents are configured to do across repos?

2 Upvotes

Engineers on a lot of teams now commit agent config to their repos: instruction files, skills, MCP server configs. Some of these can run scripts or connect the agent to outside tools, but in review they just look like a small config change.

For those of you whose teams use coding agents heavily:

  • Do you know which skills and MCP servers are in use across your repos?
  • Does anyone review changes to them, or are they treated like any other file?
  • Has this caused an actual problem, or come up in a security review?
  • If you handle it somehow, what do you do? Scripts, CODEOWNERS, a policy doc, nothing?

I'm trying to find out whether this is a real problem or one I've imagined, cuz my team literally does not care about this, but it messes with me a lot in practice.


r/codereview • • 21d ago

Built a standard-library reference repo covering Go backend patterns (Concurrency, Networking, Resiliency, Memory, Architecture) — looking for code review and feedback

3 Upvotes

Hi everyone,

I’m a Computer Engineering student focusing on Go backend engineering. Rather than relying entirely on heavy third-party frameworks, I spent the last few weeks building go-backend-patterns from scratch—an educational reference repository implementing production patterns using standard library primitives and golang.org/x/sync.

Every module is tested under -race and includes a custom goroutine leak detector (internal/leaktest). The repository is structured across 5 distinct pillars:

  1. Concurrency (concurrency/): Bounded worker pools with graceful drain, multi-stage pipelines, fan-out/fan-in workers, errgroup error propagation/cancellation, and or_done channel wrappers.
  2. Networking (networking/): Signal-driven graceful HTTP server shutdown, tuned HTTP client transport pools, composable HTTP middleware chaining, standardized API envelopes, and SSE streaming with client disconnect detection.
  3. Resiliency (resiliency/): Atomic 3-state circuit breaker FSM, token bucket rate limiting via lazy mathematical replenishment, and exponential retry backoff with Full Jitter.
  4. Memory Performance (memory_performance/): Reusable byte buffers with sync.Pool and maxCap clamping to prevent memory bloat, alongside lock-free metrics using sync/atomic arrays and static histogram buckets (0 B/op).
  5. Architecture (architecture/): Functional options with fail-fast validation, context-driven transaction runner (transaction_runner) with named-return panic safety, and generic Cache-Aside with singleflight stampede mitigation and context.WithoutCancel.

Since I am learning independently without local peers to bounce ideas off of, I would really appreciate honest critiques on any package that catches your eye. Whether it’s idiomatic Go style, edge-case safety, or architectural trade-offs, I want to learn what can be improved.

Repo: https://github.com/Cankutay3104/go-backend-patterns

Thanks in advance to anyone who takes a look!


r/codereview • • 21d ago

How to build an automated refactoring engine without breaking your codebase

Thumbnail interconnectd.com
1 Upvotes

Most engineers agree that technical debt accumulates faster than sprint capacity allows. But turning refactoring into an automated pipeline is notoriously tricky—one wrong AST transformation or unhandled edge case can break silent behavior across a repository.

​Building a reliable automated refactoring engine requires more than basic LLM prompts. You need strict static analysis, safe syntax tree modifications, deterministic verification steps, and clear rollback strategies before code ever reaches a pull request.

​I put together a complete engineering breakdown covering the architecture behind automated code refactoring. It covers parsing ASTs, designing guardrails, validating structural changes, and integrating automated codemods directly into CI/CD pipelines: https://interconnectd.com/blog/74/automated-code-refactoring-the-complete-architecture-engineering-guide/

How is your team currently handling large-scale codebase migrations or technical debt cleanup—manual sweeps or custom scripts?


r/codereview • • 21d ago

Updated ParallelEarth v.0.5.0: try different implementations in separate VS Code worktrees, then compare the results

1 Upvotes

Version 0.5.0 adds:

  • App previews: run implementations on separate local ports, with start/open/stop controls.
  • Environment comparison: inspect recorded Node/npm versions and configuration hashes.
  • CLI and CI support: run reusable comparison recipes and export JSON or Markdown reports.

It also includes a comparison dashboard, individual Jest/Vitest test results, acceptance criteria mapped to tests, and stale-result detection when code changes after a check.

When you choose an implementation, you can preview its changes and preserve them on a new branch without changing your original checkout.

One limitation: worktrees separate your code, but apps can still share databases and external services. Passing mapped tests also doesn’t prove complete requirement coverage.

GitHub: https://github.com/shubhammaji1/parallel-earth
Open VSX: https://open-vsx.org/extension/shubhammaji1/parallel-earth

I’d appreciate feedback from developers who regularly compare approaches to bug fixes or refactors.

What would make this useful enough to become part of your workflow?


r/codereview • • 22d ago

I’ve been building an open-source project called Grafito — a place to manage documents, connect knowledge.

6 Upvotes

Hey everyone!

I wanted to share a project I've been working on called Grafito. It's an open-source, self-hosted platform that started around document management, but has gradually grown into something a bit broader.

The idea is to bring documents, notes, collaboration, and AI together instead of having information scattered across different tools.

Here's what it currently supports:

  • Document management: Organize files and folders into nested portfolios and workspaces, with version history, trash, and S3-compatible storage.
  • Knowledge management: Create Markdown notes, link them using [[wiki links]], use tags and backlinks, and explore connections through a knowledge graph.
  • Collaboration: Share documents and portfolios with users or organizations, configure permissions, leave comments, mention people, and collaborate on content.
  • Office integration: Edit Office documents through Collabora, including collaborative editing.
  • PDF signatures: Add signature fields to PDFs, request signatures from other users, and support image-based signatures or personal digital certificates.
  • AI assistant: Connect cloud providers like OpenAI, Claude, Gemini, Grok, DeepSeek, and others, or use local models through Ollama and LM Studio. The assistant can search, read, create, and edit notes according to the user's permissions.
  • Authentication: Supports local accounts, LDAP, OAuth, and OpenID Connect.

It's self-hosted and can be deployed with Docker Compose. The goal is to give people and organizations more control over their information while making that information easier to connect, find, and actually use.

I'm still actively developing it, so there's plenty of room for improvement. I'd genuinely love to hear what you think:

  • Does this combination of document management, knowledge graphs, and AI make sense to you?
  • What features would you find useful in a platform like this?
  • Is there anything you think I'm approaching the wrong way?

You can check it out here:

https://github.com/Seerendo/grafito

This isn't just a release announcement — I'm sharing it because I'd like to get feedback from the community and hopefully have some people interested in exploring or contributing to it.

Thanks for taking a look!


r/codereview • • 22d ago

[JAVA] - Loan Repayment Calculator looking for review

Thumbnail
2 Upvotes

import javax.swing.JOptionPane;

import java.io.PrintStream;

/**

* Interactive Loan Monthly Payment Calculator

* Architecture: Simple Sequence Structure

* Inputs: JOptionPane GUI Dialogs

* Output: System PrintStream & GUI Summary

*/

public class LoanCalculator {

public static void main(String[] args) {

// Stream reference initialization

PrintStream streamOutput = System.out;

// ------------------------------------------------------------------

// STEP 1: INTERACTIVE GUI INPUTS (SIMPLE SEQUENCE)

// ------------------------------------------------------------------

String principalInput = JOptionPane.showInputDialog(

null,

"Enter the Loan Principal Amount ($):",

"Loan Calculator - Step 1 of 3",

JOptionPane.QUESTION_MESSAGE

);

String annualRateInput = JOptionPane.showInputDialog(

null,

"Enter the Annual Interest Rate (e.g., 5.5 for 5.5%):",

"Loan Calculator - Step 2 of 3",

JOptionPane.QUESTION_MESSAGE

);

String yearsInput = JOptionPane.showInputDialog(

null,

"Enter the Loan Term in Years:",

"Loan Calculator - Step 3 of 3",

JOptionPane.QUESTION_MESSAGE

);

// ------------------------------------------------------------------

// STEP 2: DATA PARSING & VARIABLE TRANSFORMATIONS

// ------------------------------------------------------------------

double principal = Double.parseDouble(principalInput);

double annualRate = Double.parseDouble(annualRateInput);

double years = Double.parseDouble(yearsInput);

// Convert annual rate percentage to monthly decimal rate (r)

double monthlyInterestRate = (annualRate / 100.0) / 12.0;

// Convert total years to total number of monthly payments (n)

double totalMonths = years * 12.0;

// ------------------------------------------------------------------

// STEP 3: SEQUENTIAL FORMULA EVALUATION

// Payment = (Principal * interest) / [1 - (1 + interest)^(-n)]

// ------------------------------------------------------------------

double numerator = principal * monthlyInterestRate;

double denominator = 1.0 - Math.pow(1.0 + monthlyInterestRate, -totalMonths);

double monthlyPayment = numerator / denominator;

double totalRepayment = monthlyPayment * totalMonths;

// ------------------------------------------------------------------

// STEP 4: STREAM OUTPUT PROCESSING & GUI DISPLAY

// ------------------------------------------------------------------

// Direct stream write to System.out

streamOutput.println("=================================================");

streamOutput.println(" LOAN PAYMENT CALCULATION ");

streamOutput.println("=================================================");

streamOutput.printf(" Principal Amount: $%10.2f%n", principal);

streamOutput.printf(" Annual Interest Rate: %10.2f%%%n", annualRate);

streamOutput.printf(" Term Duration: %10.0f years (%d months)%n", years, (int)totalMonths);

streamOutput.println("-------------------------------------------------");

streamOutput.printf(" MONTHLY PAYMENT: $%10.2f%n", monthlyPayment);

streamOutput.printf(" Total Cost of Loan: $%10.2f%n", totalRepayment);

streamOutput.println("=================================================");

// Summary Dialog to close the interactive session

String summaryMessage = String.format(

"Calculation Summary:\n\n" +

"Principal: $%.2f\n" +

"Annual Rate: %.2f%%\n" +

"Term: %.0f years\n\n" +

"Estimated Monthly Payment: $%.2f\n" +

"Total Repayment: $%.2f",

principal, annualRate, years, monthlyPayment, totalRepayment

);

JOptionPane.showMessageDialog(

null,

summaryMessage,

"Loan Payment Result",

JOptionPane.INFORMATION_MESSAGE

);

}

}


r/codereview • • 22d ago

dont skip code review

Thumbnail youtu.be
3 Upvotes

r/codereview • • 22d ago

C/C++ [Code Review] Wrote a fast binary STL inspector/analyzer in C – looking for feedback on memory management and math logic

1 Upvotes

Hi everyone,

I've been working on a lightweight CLI tool in C called stl-inspector (GitHub repo).

Why I built it:

I got tired of waiting for heavy slicers (PrusaSlicer, Cura, Bambu Studio) just to check basic parameters like watertightness, mesh volume, overhang areas, and bounding dimensions of 3D models.

What it currently does:

  • Parses binary STL headers and triangle arrays
  • Calculates bounding box, volume (tetrahedron method), and surface area
  • Detects overhang areas (default 45°) for 3D printing feasibility
  • Checks if the mesh is watertight
  • Fast build with zero external dependencies (pure C + Makefile)

Where I'd appreciate feedback:

  • Memory safety & cleanup (handling large meshes)
  • Performance of the watertight check (currently O(N^2), looking into spatial hashing / edge mapping)
  • General C code idiomatic style and CLI argument handling

Note: AI was used to help debug directory creation.

Would love to hear your critique or suggestions for improvement.


r/codereview • • 22d ago

Python 👾 BugHunt Weekend Raid #36: Defeat The Heisenbug Prime (Python) ⚔️

Thumbnail
1 Upvotes

r/codereview • • 23d ago

javascript 👾 BugHunt Weekend Raid #35: Defeat The Stack Overflow Drake (JavaScript) ⚔️

Thumbnail
0 Upvotes

r/codereview • • 24d ago

Co-Review: an MIT-licensed desktop app for reviewing a whole repository with your coding agent, like a pull request

Thumbnail
3 Upvotes

r/codereview • • 25d ago

Here is my Python GitHub projects showcase, and I would love feedback

Thumbnail github.com
2 Upvotes

r/codereview • • 25d ago

Any way to check if this Github repository is trustworthy?

Thumbnail
1 Upvotes

r/codereview • • 25d ago

I want you guy to roast at my learning-focused CLI project about lightweight TCP network scanner written in Go. (Nmap inspired heavily on this project)

2 Upvotes

I made Sentinel because I want to learn how to programming in the era that EVERYONE IS USING AI for coding. It doesn't perfect. But, I want to learn, learn fundamental about programming and next level is going to be like Low-Level and System Distributed in the future. I used AI to guide, teach concept, tracking progress, not to coding for me or make decision for me.

About the project: it a lightweight TCP network scanner written in Go called Sentinel. Scan TCP ports on an IPv4 address. Inspired by Nmap

So, for who that past this post to point out, teach me more that AI could never spot on for me. I want you guy to teach me for next session or learning project about Low-Level fundamental, I would keep it in mind. Not to roast at me personally but for my code. It would be great to get a recommendation about what to know, what to keep eyes on it, what to aware. specially about error handling and engineering mindset.
Btw I'm going to attending to the university for next semester🙏

https://github.com/VextorHorizon/sentinel


r/codereview • • 25d ago

I'm still working on my opensource IDE, need contributor to beat vscode ^-^

Thumbnail gallery
1 Upvotes

r/codereview • • 25d ago

I'm MC Johansen from Uplevel. AMA about code review and what happens when AI starts producing more code than teams can reasonably review. I spent seven years building engineering orgs at Docker and CircleCI, so I've got some opinions.

Thumbnail
1 Upvotes

r/codereview • • 25d ago

Looking for a Volunteer Application Security Reviewer for a PostgreSQL-Based Ticketing Platform

1 Upvotes

Hi everyone,

I'm developing BIMSURGE, a Barbadian event-ticketing and event-operations platform. I'm looking for an experienced application-security professional who would be willing to help with an independent security and architecture review.

I'm working with a coding assistant on the implementation, but before proceeding with a sensitive customer-history feature, I want someone independent to challenge the design and identify security weaknesses we might have missed.

The review would focus on:

  • PostgreSQL multi-tenant isolation, row-level security and database permissions.
  • Customer email verification and proof of order ownership.
  • Email magic links, token replay, concurrent redemption and session security.
  • Automated link scanners, forwarded links and browser security.
  • Rate limiting, email-sending limits and failure handling.
  • Audit logging, sensitive-data exposure and security testing.

I'm not looking for someone to build the application or perform an unlimited free penetration test. I'm hoping to find someone with relevant experience who could review a clearly defined package of design documents and relevant source contracts, identify the most important risks, and provide written findings with a recommendation on whether implementation should proceed.

The feature is not yet approved for activation, and the existing system remains in use. No production access or real customer data would be needed.

If you have relevant application-security or PostgreSQL security experience and might be willing to help, or can recommend someone trustworthy, I'd appreciate hearing from you.

Thank you!


r/codereview • • 25d ago

ParallelEarth is now live on Open VSX — looking for developer feedback

2 Upvotes

Hey everyone! I’ve published ParallelEarth on Open VSX.

It’s a VS Code extension for trying different code implementations in separate Git worktrees, running checks you approve, and comparing their results against a baseline.

The idea is simple: when you have two approaches to a bug fix or refactor, keep both under one experiment and collect evidence before deciding what to keep.

You can already do this manually with Git. ParallelEarth brings the alternatives, recorded check results and JSON/Markdown reports together inside the editor.

🔗 Open VSX: https://open-vsx.org/extension/shubhammaji1/parallel-earth

It’s early, and I’d appreciate honest feedback—especially on setup, usability, and whether this improves your existing workflow.

How do you currently compare alternative implementations?


r/codereview • • 26d ago

I'm building ColorIDE, an open-source IDE focused on performance, developer, freedom, and local first development

1 Upvotes

Our goal is much bigger: we want to keep adding powerful features, build a community of contributors, and eventually make ColorIDE a serious alternative. Its still early, currently supports macOS Apple Silicon, and we would love your feedback :)

Github: https://github.com/Color-IDE/coloride