37

Opening up a view file, and first thing I see is a function accepting 13 parameters.

I don't know where to start, so much wrong..

Kill me.

Comments
  • 0
    @Kashmir I don't quite know what the function does, but it's called filterList(); and spans ~300 lines.of if's and loops.

    The system is a customer system that keeps tracks of customers and orders and data about customers.
    Made in a hella old version of codeigniter

    (It's a client system, not our own, and one we inherited from a previous dev)
  • 3
    I once write a function with 19 parameters. Can do it better using structs but currently doesn't have time to refactor it.
    Anyway, my work is scientific computing so maybe I still can get away with it. But I agree with you, in real-world programming, I would frown upon it.
  • 0
    A code smell so bad I’d rather be locked in a bathroom with real bad smells
  • 0
    I eventually spend some time looking at it, and it looks like something that is relatively easy could be replaced by a SQL query.

    But that function is so engrained in the system that my fear of doing so is overwhelming,. due to the number os possible bugs i'd introduce
  • 0
    Meanwhile the method to generate an explosion in the Rimworld Modding API accepts 28 parameters
Add Comment