• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TeraTech

The ColdFusion Experts: Develop | Secure | Optimize

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

Does your ColdFusion Code Smell Bad? (16 certified checks)

January 17, 2025 By Michaela Light Leave a Comment

I am not talking about literal bad smell from your computer! I mean is there something “off” about it. Not a bug, but poor design or architecture weakness that will make maintenance a bear?

blond man bad smell sign

Holding you nose when maintaining your code?

Defn: Code smell is any symptom in your source code that may indicate a deeper problem in your system. Just like if you open your fridge door and the smell is bad that is a sign that some of your food is rotting.

“[Code] smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality” – Martin Fowler, author of the book “Refactoring.”

Code smells are (usually) not bugs — they are not broken code and don’t stop the program from run correctly. They are weaknesses in design that may slow down maintenance. Or may up your risk of future bugs and system failures.  Bad code smell is a sign that you have serious technical debt!

What to do? Start refactoring in small steps to eliminate obvious bad smells; checking that the code still functions correctly at each stage. This will often uncover other worse smells deeper in the design.

Think of it like updating an old house – you rip off some bad drywall only to uncover decrepit electrical wiring underneath.

For example, You might start refactoring out duplicate code only to discover that the database design is bad too.

Code smells indicate when to refactor, and what to do to fix it.

Where bad code smells come from

Some surprising results in an IEEE software study of 500,000 code commits in 200 open source software projects found that:

  • The majority of bad smells start at project creation, not during maintenance.
  • Although regular maintenance is responsible for most bad smells added after creation, poor refactoring can add them too.
  • Not all bad smells come from newbies on the code. Long time developers who are overworked and stressed are more likely to make new bad smells in code.

 

What do to have better smelling maintenance? Increased code review when the project is stressed!

 

The code smell zoo

zoo-24931_960_720

Application-level smells:

  • Duplicate code in different places.
  • Contrived complexity: using over-complicated design patterns where simpler design would get the job done well.

 

Class-level smells:

  • Hard coding of constants
    • Instead use named constants to both improve readability and to avoid programming errors in future maintenance. Put the constants in a CFinclude file so they are easy to find and change.
  • Orphan variable or constant class: a class that typically has a collection of constants that should be owned by another member classes.
  • Large class: it is too big to read or fix easily. A “God object”.
  • Feature envy: it uses the methods of another class too much.
  • Inappropriate intimacy: it depends on the internal coding of another class.
  • Refused bequest: it overrides a method of a base class but does not honor the original contract.
  • Lazy class/freeloader: it does too little!
  • Cyclomatic complexity: too many branches or loops. Break it up into smaller functions or write it in a simpler way.
  • Downcasting: a type cast which breaks the abstraction model → refactor/eliminate the abstraction.

 

Method-level smells:

  • Too many f*cking parameters: a long list of parameters is hard to read, and makes calling and testing the function complicated. Refactor so that responsibility is assigned in a more clean-cut way.
  • Long method: a method, function, or procedure that has grown too large.
  • Identifiers too long: eg using naming conventions to provide disambiguation rather making that clear in the software architecture.
  • Identifiers too short: the name of a variable should reflect its function. Except if it is obvious.
  • Too much return data: a function or method that returns more data than is needed to call it from all places it is used.

 

Action

Have your lead developer pick a “smell of the week” Then ask all developers to look for it during their regular work this week. They may fix the issue themselves or bring it back to you. As you go through the above smell list will gradually teach your team to be better developers.

 

PS What was the ‘worst' smell in your ColdFusion code last year? Leave a comment bellow.

  • Facebook
  • Twitter
  • LinkedIn

Filed Under: CFML, ColdFusion Maintenance, ColdFusion Training, Learn CFML, Learn ColdFusion, Legacy Code Tagged With: ColdFusion, ColdFusion code, Development Approach

← Previous Post ColdFusion Database Performance Tuning
Next Post → First 3 things to ask when hiring your next CFML developer

Primary Sidebar

Popular podcast episodes

  • Revealing ColdFusion 2021 – Rakshith Naresh
  • CF and Angular – Nolan Erck
  • Migrating legacy CFML – Nolan Erck
  • Adobe API manager – Brian Sappey
  • Improve your CFML code – Kai Koenig

CF Alive Best Practices Checklist

Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.

Get your checklist

Top articles

  • CF Hosting (independent guide)
  • What is Adobe ColdFusion
  • Is Lucee CFML now better than ACF?
  • Is CF dead?
  • Learn CF (comprehensive list of resources)

Recent Posts

  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia – Transcript
  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia
  • 107 ColdFusion 2021 Revealing Details on How it was Created with Rakshith Naresh
  • The Legacy Continues: ColdFusion Summit East Conference Edition
  • 140 BoxLang modern JVM language that runs CFML code (new CFML engine and much more) with Luis Majano and Brad Wood – Transcript

Categories

  • Adobe ColdFusion 11 and older
  • Adobe ColdFusion 2018
  • Adobe ColdFusion 2020 Beta
  • Adobe ColdFusion 2021
  • Adobe ColdFusion 2023
  • Adobe ColdFusion 2024
  • Adobe ColdFusion 2025
  • Adobe ColdFusion Developer week
  • Adobe ColdFusion Project Stratus
  • Adobe ColdFusion Summit
  • AWS
  • BoxLang
  • CF Alive
  • CF Alive Podcast
  • CF Camp
  • CF Tags
  • CF Vs. Other Languages
  • CFEclipse
  • CFML
  • CFML Open- Source
  • CFUnited
  • ColdBox
  • ColdFusion and other news
  • ColdFusion Community
  • ColdFusion Conference
  • ColdFusion Consulting
  • ColdFusion Developer
  • ColdFusion Development
  • ColdFusion Hosting
  • ColdFusion Maintenance
  • ColdFusion Performance Tuning
  • ColdFusion Projects
  • ColdFusion Roadmap
  • ColdFusion Security
  • ColdFusion Training
  • ColdFusion's AI
  • CommandBox
  • Docker
  • Fixinator
  • Frameworks
  • Fusebox
  • FusionReactor
  • IntoTheBox Conference
  • Java
  • JavaScript
  • JVM
  • Learn CFML
  • Learn ColdFusion
  • Legacy Code
  • Load Testing
  • Lucee
  • Mindmapping
  • MockBox
  • Modernize ColdFusion
  • Ortus Developer Week
  • Ortus Roadshow
  • Server Crash
  • Server Software
  • Server Tuning
  • SQL
  • Survey
  • Survey results
  • TestBox
  • Transcript
  • Webinar
  • Women in Tech

TeraTech

  • About Us
  • Contact

Services

  • Free assessment
  • Consulting
  • Crash
  • Development
  • Maintenance
  • Modernization
  • Security
  • Case Studies

Resources

  • CF Alive Book
  • CF Alive Podcast
    • Podcast Guest Schedule
  • TeraTech Blog
  • CF Alive resources
  • CF e-course
  • CF best practice checklist

Community

  • CF Alive
  • CF Inner Circle
  • CF Facebook Group

TeraTech Inc
451 Hungerford Drive Suite 119
Rockville, MD 20850

Tel : +1 (301) 424 3903
Fax: +1 (301) 762 8185

Follow us on Facebook Follow us on LinkedIn Follow us on Twitter Follow us on Pinterest Follow us on YouTube



Copyright © 1998–2025 TeraTech Inc. All rights Reserved. Privacy Policy.