Skip to content

Add rust support for introspector #1332

Open
@nathaniel-brough

Description

Hey so I'm interested in adding rust support. I think I've got a rough idea as to how this might be doable. But I'd love to get some feedback from someone a little more knowledgeable on introspector before I get started. As far as I can tell there are a few metrics that need to be collected and tied together somehow;

  • Code coverage (collected by oss-fuzz)
  • Cyclomatic complexity
  • Callgraphs (for reachable complexity/fuzz-blockers)

I'm sure there are other challenges in terms of coaxing all of this data into a format that introspector can work with as well. Am I missing anything critical here?

Code coverage

This is already collected by oss-fuzz.

Callgraphs

This can be acheived using rust-analyzer plus a specialised client for the language server that recursively queries the outgoing-calls endpoint. This would have the nice side effect that as the outgoing calls endpoint is added to other language servers the code should be portable or at least easy enough to adapt to other languages e.g. clangd is in the process adding support for this endpoint, clojure already supports it. Not suggesting here that this approach should replace existing clang/llvm-opt callgraphs just mentioning for completeness.

Cyclomatic complexity

This can be implemented with rust-code-analysis, worth noting that this also supports a bunch of other languages besides rust as well as metrics other than cyclomatic complexity.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions