33
Views
2
Comments
performance complexity

I have a Function and i want to calculate the  time  the  function need to run it and the complexity

2020-05-07 18-53-00
Rui Barradas
 
MVP

Hello there,

Hope you’re doing well.

If you want to calculate the time that your action needs to execute, you just need to have a time stamp in the beginning of the logic (or right before you call the action), do the same in the end of the logic (or right after the call), then to the diff between these 2 and you will get the time you pretend.


Kind regards,

Rui Barradas

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi Obadah,

I addition to what Rui shared, calculating the complexity of an client or server action is not a direct feature within the OutSystems platform.

But here are some guidelines:

  • An action with more than 20 nodes or an action with more than 40 nodes is hard to maintain, especially if it has no comments to explain the logic.  Best is to refactor parts of the action in separate actions.
  • The more IF and Switch nodes you have the higher the cyclomatic complexity. More IFs means mor test cases to cover.
  • Recursive calls, can also be perceived as complexity, although elegant to code, not always easy to debug when things go wrong.
  • Using unnecessary Advanced SQL over Aggregates creates unnecessary complexity.
  • Not commenting and documenting your code, makes it more complex for another developer to understand.

Use AI Mentor Studio to evaluate if your action is reported on any of the code patterns it evaluates.

-- Daniel


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.