Skip to content

Decorated functions specifying a PYTHONPATH don't show up in the call graph #198

Open
ponder-lab/ML
#107
@khatchad

Description

Decorated functions that are part of a PYTHONPATH, i.e., it's name is qualified with a directory path, don't show up in the call graph.

For example, suppose we have the following:

https://github.com/ponder-lab/ML/blob/6974735c51fd827cdfef4d7a58fa7442a2a615c4/com.ibm.wala.cast.python.test/data/proj49/src/test_module10.py#L3-L9

Further suppose that the above file is under the src directory. The name of the about function is then Lscript src/test_module10.py/test_dummy. Somehow, when functions have names under directories like src, they are not getting captured in the closure provided by the decorator summary:

<class name="pytest" allocatable="true">
<method name="import" static="true" descriptor="()Lpytest;">
<new def="x" class="Lpytest" />
<new def="mark" class="Lobject" />
<putfield class="LRoot" field="mark" fieldType="LRoot" ref="x" value="mark" />
<new def="parametrize" class="Lpytest/class/parametrize" />
<putfield class="LRoot" field="parametrize" fieldType="LRoot" ref="mark" value="parametrize" />
<new def="skip" class="Lpytest/class/skip" />
<putfield class="LRoot" field="skip" fieldType="LRoot" ref="mark" value="skip" />
<new def="skipif" class="Lpytest/class/skipif" />
<putfield class="LRoot" field="skipif" fieldType="LRoot" ref="mark" value="skipif" />
<return value="x" />
</method>
</class>
<package name="pytest/class">
<class name="Parametrize" allocatable="true">
<method name="do" descriptor="()LRoot;" numArgs="2" paramNames="self test">
<putfield class="LRoot" field="params" fieldType="LRoot" ref="test" value="self" />
<return value="test" />
</method>
</class>
<class name="parametrize" allocatable="true">
<method name="do" descriptor="()LRoot;" numArgs="4" paramNames="self params values extra">
<new def="closure" class="Lpytest/class/Parametrize" />
<putfield class="LRoot" field="test" fieldType="LRoot" ref="closure" value="self" />
<putfield class="LRoot" field="params" fieldType="LRoot" ref="closure" value="params" />
<putfield class="LRoot" field="values" fieldType="LRoot" ref="closure" value="values" />
<return value="closure" />
</method>
</class>

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions