SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Error when extracting requirements #318

Closed dgarijo closed 2 years ago

dgarijo commented 2 years ago

If I do:

code_inspector -i ../test_repos/somef/src -o test_dir -r

then, I get some results (although incomplete). But if I do

code_inspector -i ../test_repos/somef/src -o test_dir -r -si

I get the following error:

Traceback (most recent call last):
  File "/home/dgarijo/Documents/GitHub/code_inspector/env_3.9/bin/code_inspector", line 33, in <module>
    sys.exit(load_entry_point('code-inspector', 'console_scripts', 'code_inspector')())
  File "/home/dgarijo/Documents/GitHub/code_inspector/env_3.9/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/dgarijo/Documents/GitHub/code_inspector/env_3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/dgarijo/Documents/GitHub/code_inspector/env_3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/dgarijo/Documents/GitHub/code_inspector/env_3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/dgarijo/Documents/GitHub/code_inspector/code_inspector/cli.py", line 1276, in main
    all_soft_invocation_info_list = extract_software_invocation(dir_info, directory_tree_info, input_path,
  File "/home/dgarijo/Documents/GitHub/code_inspector/code_inspector/utils.py", line 160, in extract_software_invocation
    if elem["main_info"]["main_flag"]:
TypeError: string indices must be integers
rosafilgueira commented 2 years ago

Fixed the error