infer
infer copied to clipboard
Can I use infer static analysis to find a string?
I can use infer static analysis to find
- Does a function exist?
- How many functions exist? Which class exists? For example, "sscanf", "strncpy"
hello
I think you're not getting much of a reply, because your question doesn't (really) make sense in the context of infer
.
infer
is a static analysis tool aimed at finding bugs in source code; it is not designed to find the kind of metrics you're after.
That being said, you can "abuse" infer to answer your "functions" question:
echo "select proc_uid, source_file from procedures;" | sqlite3 infer-out/results.db
You'll also see classes here, if you have methods in classes -- just using a type isn't enough for it appear in the results.db
.
Types are logged to the tenv
file if you run with debugging (run with -g
and then look for files ending with .tenv.debug
).
I think you're not getting much of a reply, because your question doesn't (really) make sense in the context of
infer
.
infer
is a static analysis tool aimed at finding bugs in source code; it is not designed to find the kind of metrics you're after.That being said, you can "abuse" infer to answer your "functions" question:
echo "select proc_uid, source_file from procedures;" | sqlite3 infer-out/results.db
You'll also see classes here, if you have methods in classes -- just using a type isn't enough for it appear in the
results.db
.Types are logged to the
tenv
file if you run with debugging (run with-g
and then look for files ending with.tenv.debug
).
I mean, in the project, I want to use infer to count the number of times a string appears and the file name where it appears. Does infer have any methods in this regard, or can I customize such statistical methods in infer?
-
Infor is there a method to count a string?
-
If not, can I customize this method in infer?
I want [...] to count the number of times a string appears and the file name where it appears
So you want grep -c
?
I want [...] to count the number of times a string appears and the file name where it appears
So you want
grep -c
?
NO, I want to analysis xx.ipa or xx.app or xx.xcworkspace