Skip to contentSkip to conversation

Suppressing a couple of matches

Cocci Markus Elfring 1 participant 1 message Jun 8, 2020

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

Let us suppose that I want to suppress a couple of matches because they are false-positives.

Do you try to avoid the generation of false positives for your source code analysis?

Quoted 2 lines

However, I still want to check they exists in finalize block and print a warning otherwise. This is some kind of self-check for a rule.

I might stumble on understanding difficulties according to such a terse description of a software design goal.

Quoted 2 lines

# Always prints []. Is it normal?
#print(cocci.files())

* Are you looking for better documentation of this programming interface?

* Which information do you expect to be available in a SmPL initialisation rule?

Quoted 1 line

def relevant(p): # suppress functions from blacklist

…

Quoted 1 line

return False if blacklist & { el.current_element for el in p } else True # intersection

To which information should the variable “el” refer?

Quoted 5 lines

@rp depends on patch@
position p: script:python() { relevant(p) };
@@

- function1@p();

Can the use of a metavariable with the type “identifier” be eventually also helpful?

Regards,
Markus
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci