{"id":19512105,"url":"https://github.com/nccgroup/call_map","last_synced_at":"2025-04-26T04:31:17.945Z","repository":{"id":48336037,"uuid":"84102019","full_name":"nccgroup/call_map","owner":"nccgroup","description":"Current development for Call Map takes place at https://github.com/ajylee/call_map. Call Map is a tool for navigating Python call graphs. ","archived":false,"fork":false,"pushed_at":"2021-07-31T18:07:00.000Z","size":385,"stargazers_count":28,"open_issues_count":1,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T07:51:10.325Z","etag":null,"topics":["code-review","gui","tool"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nccgroup.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-06T17:34:52.000Z","updated_at":"2023-11-07T12:44:50.000Z","dependencies_parsed_at":"2022-09-15T17:02:24.576Z","dependency_job_id":null,"html_url":"https://github.com/nccgroup/call_map","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nccgroup%2Fcall_map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nccgroup%2Fcall_map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nccgroup%2Fcall_map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nccgroup%2Fcall_map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nccgroup","download_url":"https://codeload.github.com/nccgroup/call_map/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250931009,"owners_count":21509798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-review","gui","tool"],"created_at":"2024-11-10T23:24:19.883Z","updated_at":"2025-04-26T04:31:17.612Z","avatar_url":"https://github.com/nccgroup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==========\n Call Map\n==========\n\n\n.. default-role:: code\n\nAbout\n======\n\nCall Map is a tool for navigating call graphs in Python, with plans to support\nother languages. Below is a screen shot after running `call_map -m toolz`, then\nclicking on some functions.\n\n.. figure:: docs/UI-clicked-on-function.png\n\nWhile Call Map is intended to help in gaining a general\nunderstanding of a codebase, it is also a natural fit for tracing code paths,\nwhich constitutes an important security concern. Many security issues are\nrevealed by finding a code path that connects user input to dangerous coding\npatterns.\n\nSee the `blog post`__ for more.\n\n__ https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2017/july/call-map-a-tool-for-navigating-call-graphs-in-python/\n\n\nInstallation\n=============\n\nCall Map is distributed as a python package for `Python 3.5`. To install with\n`pip3`, run::\n\n  # From top level directory of call_map\n  pip3 install -e .\n\nNote that some Python 3 distributions call the package manager `pip`, and some\ncall it `pip3`, so you may need substitute `pip3` with `pip`.\n\nThe above commands should install the executable `call_map` to the same path\nthat the Python interpreter is in.\n\nFor details and alternative methods see `INSTALL.rst`.\n\n\nQuick Start\n============\n\nOpen files to start exploring::\n\n  call_map -f example.py\n\n  # you can also open multiple files\n  call_map -f *.py\n\n\nYou can also add to the module search path (`sys.path`)::\n\n  call_map -f *.py -p .\n\nCall Map will try to resolve the files as modules whenever they can be found in\nthe module search path. For more documentation on command line\narguments, `call_map -h`.\n\n\nConfiguration\n=============\n\nTo configure Call Map, set the environment variable CALL_MAP_RC_DIRECTORY.\nThe path to the Call Map configuration file will be::\n\n  $CALL_MAP_RC_DIRECTORY/call_map_rc.py\n\nAt this time the configuration options are:\n\n- `open_in_editor(path: pathlib.Path, line: int)`: if you define this function\n  it will be called whenever you open a file. For example, the following can be\n  used to open files in an Emacs server if have you called `server-mode` in a\n  running Emacs session::\n\n    def open_in_editor(path, line):\n        import subprocess as sbp\n        sbp.call(['emacsclient', '+{}'.format(line), str(path)])\n\n  The following can be used to open files in the GVim server if you started a GVim\n  server with `gvim --servername my_vim_server`::\n\n    def open_in_editor(path, line):\n        import subprocess as sbp\n        sbp.call(['gvim', '--servername', 'my_vim_server', '--remote', '+{}'.format(line), str(path)])\n\n\n- `MULTITHREADING`: Whether to use a separate thread for the GUI and searching\n  the call graph. Defaults to `True`. Turning it off is for debug purposes.\n\n\nQuirks\n=======\n\nThere are a couple of quirks in the UI design, due to the fact that I haven't\narrived at a better solution or the tradeoff of additional complexity is\nunfavorable.\n\n- Usages can appear to show up more than once, but actually they are different\n  usages in the same scope.\n\n- You may notice some bulitins such as `help`, `id`, and `filter` are ignored.\n  See `call_map/config.py` in the source code for the full list of ignored\n  functions.\n\n- If the position to be highlighted is at the start of a file, it won't be\n  highlighted. This is because typically only modules and scripts are positioned\n  at the start of their respective files.\n\n\nQuirks Inherited from Jedi \n---------------------------\n\nSome quirks are inherited from the `jedi` Python analysis backend.\n\n- The search scope for usages is the set of modules that have been loaded by the\n  `jedi` backend. That means that the scope will change as you explore new\n  modules. If you want to explicitly include a module in the search scope, add\n  it to the initial list of modules to be inspected.\n\n- `jedi` always searches the interpreter's `sys.path`, even when it is not\n  explicitly included. However, it will prioritize the user-defined `sys_path`.\n\n\nCaveats\n========\n\nAny caveats that exist for static analysis backends also apply to Call Map. (At\nthis time only the `jedi` backend is integrated into Call Map.)\n\n\nJedi\n-----\n\nThe `jedi` backend for Python analysis does not always find all usages. The\ndynamic nature of Python makes it impossible to always determine the definition\nof a function with static analysis. Sometimes `jedi` resolves a call to multiple\npossible functions. For example `os.path.abspath` depends on the platform. In\nthis case `call_map` lists both possibilities as `abspath` and `abspath (2)`.\n`jedi` also does not resolve all calls and usages. Jedi's own documentation also\nhas a `list of caveats`__.\n\nSometimes when Jedi throws an error when analyzing one item, the error affects\nother items. For example, when finding usages, if Jedi raises an error on one\nusage, the other usages it has found may be unrecoverable (as of Jedi v0.10.0).\n\n__ https://jedi.readthedocs.io/en/latest/docs/features.html#caveats\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnccgroup%2Fcall_map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnccgroup%2Fcall_map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnccgroup%2Fcall_map/lists"}