Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php code smell detector

Regarding the php code smell detector at http://c2.com/cgi/wiki?DetectingCodeSmellsInPhp

When I open it in my web browser, I get an error, but when I open it in my IDE, I don't.

How to correct it?

like image 935
Delirium tremens Avatar asked Dec 31 '22 00:12

Delirium tremens


1 Answers

Detecting a definitive code smell with code will possible the same day the halting problem will be fixed. *takes off joke hat*

What he is just doing is setting some parameters on what he thinks is bad code. And it's wrong (imo)

Having equal or more than 4 parameters is a code smell? He himself has that in the code smell detector!

More than 20 lines for a function is a code smell? The main function in this code smell detector is 49 lines of code!!

Code smell is not a thing you can program, in some cases the best way to do some function is the non standard way (whatever that way is) and in other cases it is not. You just have to trust your instinct and do as Frank Farmer said in the comments above. Just take a good wiff.

like image 79
Ólafur Waage Avatar answered Jan 10 '23 11:01

Ólafur Waage