koknat / callGraph

A multi-language tool which parses source code for function definitions and calls
GNU General Public License v3.0
245 stars 28 forks source link

Could it generate file level dependency? #17

Closed happyhebaby closed 1 year ago

happyhebaby commented 1 year ago

Hi, I have two questions around the tool, thanks for your info.

  1. Does it generate json or xml format output that could be consumed by code?
  2. Does it generate file level dependency with corresponding file path info? For example flask repo has a test file tests/test_appctx.py that has the following import statements:
    import pytest
    import flask
    from flask.globals import app_ctx
    from flask.globals import request_ctx

    I am looking for output of file level dependency like the following:

    
    "tests.test_appctx": {
    "imports": [
      "flask",
      "flask.globals",
      "pytest"
    ],
    "name": "tests.test_appctx",
    "path": "/Users/myuserid/python/flask/tests/test_appctx.py"
    },
koknat commented 1 year ago

1) There is a new option for producing json: -jsnOut filename It works similar to the existing option: -ymlOut filename

2) It does not parse 'import' or 'from' statements. It only parses function definitions and calls

happyhebaby commented 1 year ago

Thank you!