Skip to content

Repository files navigation

Code Smells Found in Code

  1. Duplicate Code
  2. Magic Strings
  3. Long Function / Mixed Responsibilities

Refractoring Patterns Applied

1. Extract Function

Created an updateUI() function to handle counter updates and color changes reducing amount of longer functions

2. Replace Magic String with Constant

Defined constants like INCREMENT_ID, RESET_ID, and color variables to improve readability and make changes easier in the future.

3. Split Phase

Separated the code into two clear phases:

  • createUI() handles HTML creation.
  • attachEventListeners() connects button logic.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages