← Latest papers
💻 computer science

An Empirical Evaluation of Code Smell Detection in Angular Applications

This study presents the first catalog of Angular-specific code smells derived from grey literature and demonstrates the high effectiveness of an automated static analysis tool in detecting these issues, achieving accuracy above 0.88 and F1-scores up to 1.00.

Original authors: Maykon Nunes, Emanuel Coutinho, Carla Bezerra, Ivan Machado

Published 2026-05-01
📖 5 min read🧠 Deep dive

Original authors: Maykon Nunes, Emanuel Coutinho, Carla Bezerra, Ivan Machado

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are building a massive, intricate house using a specific set of blueprints and tools called Angular. It's a popular way to build modern web applications because it's strong, organized, and has everything you need built-in. However, just like in real-life construction, if you aren't careful, you can start cutting corners or building things in messy ways. These messy habits are called "code smells."

Think of a code smell not as a broken wall, but as a warning sign—like a weird noise in the engine or a door that sticks. It doesn't mean the house will collapse immediately, but it suggests that the design is flawed, and if you keep ignoring it, the house will become a nightmare to fix or expand later.

This paper is like a team of expert home inspectors (researchers) who went into the community of Angular builders to ask: "What are the most common bad habits you see?" They didn't just look at official rulebooks; they listened to the builders in forums, blogs, and chat groups (what the paper calls "grey literature").

Here is what they found and did, explained simply:

1. The Detective Work: Finding the Smells

The researchers acted like detectives, sifting through hundreds of online discussions to find recurring complaints. They ended up identifying 11 specific "bad habits" that Angular developers often fall into.

To help you understand, here are a few of these smells with simple analogies:

  • The "Kitchen Sink" Component (Large Component): Imagine a single room in your house that tries to be the kitchen, the bedroom, the bathroom, and the garage all at once. In Angular, this happens when one piece of code tries to do too many different jobs. It becomes huge, confusing, and hard to clean.
  • The "Magic Box" (Overusing any type): Angular uses a language called TypeScript, which is like a strict safety inspector that checks if you are putting the right kind of bricks in the right holes. Sometimes, developers get lazy and say, "Just put whatever you want here," by using a "magic box" called any. This turns off the safety inspector. The house might look fine today, but later, a heavy sofa might fall through a floor that wasn't built for it because the inspector wasn't watching.
  • The "Tug-of-War" (Excessive Parent-to-Child Communication): Imagine a parent constantly yelling instructions to a child, or worse, the parent reaching into the child's room to rearrange their furniture directly. In Angular, components should talk politely. When a parent component grabs a child component and forces it to change its state directly, it creates a tight, messy knot that is hard to untangle.
  • The "Direct Hammer" (Direct DOM Manipulation): Angular has a special way of painting the walls (the screen) automatically. Sometimes, developers get impatient and grab a hammer to hit the wall directly, bypassing the automatic painter. This works for a moment, but it breaks the system's ability to keep the house consistent.
  • The "Copy-Paste" House (Duplicated Component): Imagine building two identical kitchens in the same house because you forgot you already built one. This wastes space and means if you want to change the sink, you have to remember to change it in two places.

2. The Overlap: Angular vs. React

The researchers also noticed something interesting. They compared these Angular smells to bad habits found in React, another popular building framework.

  • The Common Ground: About half of the bad habits (like the "Kitchen Sink" or "Copy-Paste" issues) are the same in both Angular and React. It turns out that when you build with blocks, humans make the same mistakes regardless of the brand of blocks they use.
  • The Unique Smells: Some smells are unique to Angular, usually related to its specific rules for how it updates the screen or handles data.

3. The Solution: A New "Sniffer" Tool

Once they had their list of 11 smells, the researchers didn't just write a report; they built a robot inspector.

  • They took existing tools that could smell bad habits in React and upgraded them to understand Angular.
  • This new tool scans your code files, looks for the specific patterns of these 11 smells, and flags them for you.

4. The Test: Did the Robot Work?

To see if their robot was any good, they tested it on a set of real, open-source Angular projects. They manually checked the code first to make sure the smells were actually there, then let the robot run.

  • The Results: The robot was surprisingly good. It caught the bad habits with very high accuracy (over 88% correct) and was almost perfect at finding the "Magic Box" (any type) and "Copy-Paste" issues.
  • The One Glitch: The robot sometimes got a little too excited about size. If a file was just naturally large because the job was complex (like a big, legitimate warehouse), the robot sometimes flagged it as a "Large File" smell, even if it was organized well. It's like a security guard who stops everyone who is carrying a heavy box, even if they are just moving furniture.

Why This Matters

The main takeaway is that this study created the first official catalog of Angular-specific bad habits, based on what real developers actually talk about. They proved that we can build automated tools to catch these issues early, helping developers keep their digital houses clean, safe, and easy to expand in the future.

In short: They listened to the builders, listed the common mistakes, built a robot to find those mistakes, and showed that the robot works very well.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →