Skip to content

Resolve runtime bugs, dead code, and useless assignments across BrainPortal#1610

Merged
prioux merged 1 commit into
aces:masterfrom
RafsanNeloy:Dead_code
Mar 28, 2026
Merged

Resolve runtime bugs, dead code, and useless assignments across BrainPortal#1610
prioux merged 1 commit into
aces:masterfrom
RafsanNeloy:Dead_code

Conversation

@RafsanNeloy
Copy link
Copy Markdown
Contributor

Fixes a NoMethodError caused by detect? (non-existent method), a typo sefl to self in Messagerender_attr, a wrong file path in File.size() inside extract_from_archive, and a variable name mixup in tools_controller that leaked inaccessible bourreau tool configs. Also removes useless assignments inside inject blocks and dead reqenv variables across controllers and models. Also removed line(479-480) from bourreaux_controller.rb

Signed-off-by: RafsanNeloy <rafsanneloy@gmail.com>
@prioux
Copy link
Copy Markdown
Member

prioux commented Mar 28, 2026

Sure, this all seems fine.

How did you find all of this? Did you use some AI code scanning tool?


As a side note, the change to inject() wasn't necessary, because in Ruby a block like

a.inject { |total,x| total + x }

works just as well as

a.inject { |total,x| total += x }

since the inject() method always re-assigns the block's returned value to total anyway.

@prioux
Copy link
Copy Markdown
Member

prioux commented Mar 28, 2026

Never mind about my first comment, I was reading things backwards and you changed some "+=" INTO "+" instead.

@prioux
Copy link
Copy Markdown
Member

prioux commented Mar 28, 2026

I reviewed all the changes and they are all approved.

At the same time, I discovered other bugs in the code, so I will make a commit after this is merged.

@prioux prioux merged commit 971522f into aces:master Mar 28, 2026
1 check passed
@RafsanNeloy
Copy link
Copy Markdown
Contributor Author

RafsanNeloy commented Mar 29, 2026

Sure, this all seems fine.

How did you find all of this? Did you use some AI code scanning tool?

As a side note, the change to inject() wasn't necessary, because in Ruby a block like

a.inject { |total,x| total + x }

works just as well as

a.inject { |total,x| total += x }

since the inject() method always re-assigns the block's returned value to total anyway.

Yes, Actually I use different extentions like Code Spell Checker or Trunk Code Quality to check the typo of code in which file I visit. I'm currently understanding the cbrain api endpoints and the codebase, so some files has the typo and errors are showing in the files. That's why actually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants