juice-shop/juice-shop · from the deep scan of 31 Oct 2026, 14:12 UTC
Code fitness · 78,238 lines in 816 files
Getting heavyCopied code between files and 78,238 lines of code. Only tidy up if you notice changes getting slower or bugs coming back.
⚠️ Before you change anything: Your app works today. Tidying is optional, and any change can break something. Only tidy up if you’re noticing these problems: bugs coming back, changes getting slower or costlier. Before any change, make sure GitHub has a copy you can go back to. Do one step at a time and test after each. If you’re unsure, leave it. Verilay checks your code; it doesn’t change it. For bigger tidy-ups, have a developer review the plan first.
78,238
lines of code in 816 files
0
very large files (3,000+ lines)
36
copy-pasted blocks
0
settings written in many places
0
test or debug screens in the app
0
files that may be unused
What do these numbers mean?
Lines of code: How much code your app has. The more there is, the more your AI builder has to read for every change.
Very large files: Files over 3,000 lines. The AI can’t keep a whole file like that in mind, so its changes can break parts it didn’t look at.
Copied code: Lines of code that also appear in another file. Some copying is normal. It only matters when a bug fixed in one copy is still there in the other.
Settings written in many places: A number like a price, size limit or trial length, typed into several files instead of one. Change it in one place, and the others stay old.
Test or debug screens: Pages made for testing that are still part of your app. Visitors might find them and see things meant only for you.
Files that may be unused: Files nothing else in your app refers to, usually old versions. Your AI builder may edit one by mistake, so your change seems to do nothing.
Big, tangled code is slower and costlier for an AI builder to change, and every change is more likely to break something. Your 5 biggest files hold 5% of your code.
Sound familiar? Here’s what we found
Each question is something builders notice. The number under it is the reason, measured in your code.
Fixed a bug, and it came back somewhere else?
The same code in two places: a fix to one copy misses the other. Some copying is normal: it only matters if you keep fixing the same bug twice.
⚠️ Before you change anything: Your app works today. Tidying is optional, and any change can break something. Only tidy up if you’re noticing these problems: bugs coming back, changes getting slower or costlier. Before any change, make sure GitHub has a copy you can go back to. Do one step at a time and test after each. If you’re unsure, leave it. Verilay checks your code; it doesn’t change it. For bigger tidy-ups, have a developer review the plan first.
Worth tidying, if you notice these problems
One at a time, and only if you’re seeing the problems above. Each prompt asks your AI builder to report first and change nothing until you agree. Make sure GitHub has a copy you can go back to before you say yes.
1Merge the copy-pasted code shared by the faucet and sandbox
The faucet and web3-sandbox screens share 27 identical blocks, so a fix in one often misses the other and the bug comes back. Your AI also has to read and change both copies, which costs more credits per change.
Step 1: paste this into your AI builder. It explains the problem first and changes nothing.
Please REPORT only and change nothing yet. Look at frontend/src/app/faucet/faucet.component.ts and frontend/src/app/web3-sandbox/web3-sandbox.component.ts and list the blocks of 8+ identical lines they share (there should be about 27). Tell me what each shared block does in plain English and which ones are safe to move into one shared file. Then, as one small step after I approve, move only the shared blocks into a single shared helper file (for example a shared web3 service) and make both components use it, without changing how either screen looks or behaves. When done, check that every screen that uses this code (the faucet and the web3 sandbox) still works and tell me what you tested.
Please don't change anything yet. In plain English, tell me:
1. What exactly would this tidy-up change, file by file?
2. What relies on this code working the way it does now: other pages, a mobile app that is already released, scheduled jobs, webhooks, emails, payments or sign-in?
3. What could the tidy-up break, and how would we avoid that?
4. How will we check afterwards that everything still works?
Don't change anything until I reply.
Step 2: only when its answer makes sense to you, paste this to let it make the change.
Thanks. Please fix only the place named in this report, not the other places you listed: we'll do those separately, one at a time. Keep everything you listed working. Don't publish or deploy anything. I'll test it in the preview first. Then tell me exactly what you changed, file by file, and walk me through the checks from your answer so I can confirm everything still works. If there's a mobile app that's already released, remind me to test it after publishing.
2Pull wallet code into the same shared helper
The wallet screen repeats 16 blocks from the faucet and 16 from the sandbox, so one wallet fix can need three separate edits. Missing one leaves the app behaving differently on different screens.
Step 1: paste this into your AI builder. It explains the problem first and changes nothing.
Please REPORT only and change nothing yet. Compare frontend/src/app/wallet-web3/wallet-web3.component.ts with frontend/src/app/faucet/faucet.component.ts and frontend/src/app/web3-sandbox/web3-sandbox.component.ts. List the blocks of 8+ identical lines the wallet shares with each (about 16 with each) and say whether they are already covered by a shared helper. Then, as one small step after I approve, make the wallet component use the shared helper for those blocks instead of its own copies, leaving everything else untouched. Finally, check that every screen that uses this code (wallet, faucet and web3 sandbox) still works and tell me what you tested.
Please don't change anything yet. In plain English, tell me:
1. What exactly would this tidy-up change, file by file?
2. What relies on this code working the way it does now: other pages, a mobile app that is already released, scheduled jobs, webhooks, emails, payments or sign-in?
3. What could the tidy-up break, and how would we avoid that?
4. How will we check afterwards that everything still works?
Don't change anything until I reply.
Step 2: only when its answer makes sense to you, paste this to let it make the change.
Thanks. Please fix only the place named in this report, not the other places you listed: we'll do those separately, one at a time. Keep everything you listed working. Don't publish or deploy anything. I'll test it in the preview first. Then tell me exactly what you changed, file by file, and walk me through the checks from your answer so I can confirm everything still works. If there's a mobile app that's already released, remind me to test it after publishing.
3Share the setup between the two web3 modules
The wallet-web3 and web3-sandbox modules share 5 identical blocks of setup, so adding or changing something means editing both and risking a mismatch. It's a small duplication that tends to cause confusing 'works here, not there' errors.
Step 1: paste this into your AI builder. It explains the problem first and changes nothing.
Please REPORT only and change nothing yet. Look at frontend/src/app/wallet-web3/wallet-web3.module.ts and frontend/src/app/web3-sandbox/web3-sandbox.module.ts and list the 5 blocks of 8+ identical lines they share. Explain in plain English what each block sets up and whether it could live in one shared module. Then, as one small step after I approve, move only those shared pieces into one shared module and have both modules import it, without changing what either screen does. When done, check that every screen that uses these modules (the wallet and the web3 sandbox) still loads and works, and tell me what you tested.
Please don't change anything yet. In plain English, tell me:
1. What exactly would this tidy-up change, file by file?
2. What relies on this code working the way it does now: other pages, a mobile app that is already released, scheduled jobs, webhooks, emails, payments or sign-in?
3. What could the tidy-up break, and how would we avoid that?
4. How will we check afterwards that everything still works?
Don't change anything until I reply.
Step 2: only when its answer makes sense to you, paste this to let it make the change.
Thanks. Please fix only the place named in this report, not the other places you listed: we'll do those separately, one at a time. Keep everything you listed working. Don't publish or deploy anything. I'll test it in the preview first. Then tell me exactly what you changed, file by file, and walk me through the checks from your answer so I can confirm everything still works. If there's a mobile app that's already released, remind me to test it after publishing.
Measured by counting, from every file in your repository. “May be unused” is a hint, not proof: check before deleting anything.