What's that smell?

"Smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality"

What's that smell?

var itemAvailable = true;

if (itemAvailable === true) {
    // Add to cart
} else {
    // Notify store owner
}
var itemAvailable = true;

if (itemAvailable === true) {
    // Add to cart
} else {
    // Notify store owner
}

What's that smell?

function(product, model, brand, color, size, distributor, location, price) {
    // save product properties
}
function(properties) {
    // save product properties
}

Other Code Smells

  • Large Class: A object has grown too large
  • Feature Envy: Using methods of another object excessively
  • Inappropriate Intimacy: A object having dependencies on implementation details of another object
  • Lazy object: A object that does too little
  • Cyclomatic Complexity: Too many branches and loops
  • Excessive returns: Too many return values

What's that smell?

By genuchelu

What's that smell?

  • 426