Reduce false positives in AI Mentor Duplicated Code detection for SQL-based Actions
80
Views
0
Comments
New
Architecture & Governance 

Hi everyone,

I’ve noticed something with the "Duplicated Code" pattern in AI Mentor that has been causing a lot of false positives in real projects.

Right now, the detection seems to focus mostly on the Action flow structure (basically the “shape” of the logic).

The problem is that many Actions in OutSystems naturally share the same simple pattern, like:

Start → SQL → Assign → End

So even when two Actions have completely different SQL queries and return different Output Structures, AI Mentor still flags them as duplicated just because the flow looks the same.

In practice, these aren’t duplicates at all. They just follow the same architectural pattern.

Trying to merge them usually doesn’t make sense, can hurt readability, and sometimes even impacts performance.

Suggestion

It would help a lot if the duplication check also considered the SQL widget details and the Action contract, not only the flow.

For example, avoid flagging when:

  • the SQL statement text is clearly different

  • the Output Structure is different

  • the returned data shape is different

Maybe duplication should only be reported when the flow and the SQL and the outputs are very similar.

This would make the detection more semantic instead of purely structural.

Benefits 

Reducing these obvious false positives would:

• Reduces false positives 
• Less time wasted marking valid code as “Won’t Fix” or "False Positive"
• Prevents unnecessary refactoring that may hurt performance
• Increases developer trust and adoption of the tool 

I think this small change could make the Duplicated Code pattern much more accurate and much more valuable in day-to-day development.

Thanks!