Code Analysis - Rule 6746 - COUNT

I started to analyze my code using Toad Code Analysis.
I always get a warning for code like this:

FORALL i IN 1 .. some_array.COUNT SAVE EXCEPTIONS

This identifier has the name of a built-in function or package.

How can I fix this?
Tanks!

Are you meaning that the rule which calls this out is bothersome? If so, you can uncheck the rule so it doesn't apply when you analyze your code.

Many thanks, Gary. But unchecking may not be the idea behind this checks?
If we add the brackets to it:
FORALL i IN 1 .. some_array.COUNT () SAVE EXCEPTIONS
It works as should.
Maybe an update on the rule would help?
Thanks.

Hello roschit,

Glad to read your feedback! Some rules are far from perfect but we can adjust them quickly if needed. And your help is very valuable here.

The overall goad of this rule 6746 ('This identifier has the name of a built-in function or package') is to warn against unintended clashes of variable names with built-ins. We're finding ourselves on a slippery path...

Currently the rule reads:

//QNAME [not(PARAM_LIST)]/
IDENTIFIER[last()] [qp5:is-built-in-function(@value) or qp5:is-built-in-package(@value)]

and translated to human language:
Find all variable names of the form a.b.c.... which have no parameter list, and for each of them consider the rightmost part (c in our case) and find out whether this is a built-in function or a built-in package.
Oof.

What logic would you suggest? Just in words. I appreciate your input!

Andre