Skip to main content

Next-generation codebase analysis toolkit.

Project description

ScubaTrace

ScubaTrace

Usage

import scubatrace
a_proj = scubatrace.CProject("../tests")
print(a_proj.files["src/test.c"].structs[0].name)
print(a_proj.files["src/test.c"].functions[0].name)
print(a_proj.files["src/test.c"].functions[0].calls)
print(a_proj.files["src/test.c"].functions[0].callee)
print(a_proj.files["src/test.c"].functions[0].caller)
print(a_proj.files["src/test.c"].functions[0].statements[0].variables[0].ref_statements)
print(a_proj.files["src/test.c"].functions[0].statements[0].variables[0].defination)
print(a_proj.dependencies)
print(a_proj.licences)

Development

Project

def files(self) -> dict[str, File]:
def functions(self) -> list[Function]:
def classes(self) -> list[Function]:
def methods(self) -> list[Function]:

File

def abspath(self) -> str:
def relpath(self) -> str:
def text(self) -> str:

def imports(self) -> list[File]: ...
def accessible_files(self) -> list[File]: ...

def functions(self) -> list[Function]: ...
def functions(self) -> list[Function]: ...

Function

def text(self) -> str:
def start_line(self) -> int:
def end_line(self) -> int:
def length(self):
def lines(self) -> dict[int, str]:
def body_node(self) -> Node | None:
def body_start_line(self) -> int:
def body_end_line(self) -> int:
def name(self) -> str: ...

def accessible_functions(self) -> list[Function]: ...
def callees(self) -> list[Function]: ...
def callers(self) -> list[Function]: ...
def calls(self) -> dictlist[Statement]: ...
def statements(self) -> list[Statement]: ...

Class

def text(self) -> str:
def start_line(self) -> int:
def end_line(self) -> int:
def length(self):
def name(self) -> str: ...

def methods(self) -> list[Method]: ...
def fields(self) -> list[str]: ...
def parents(self) -> list[Class]
def children(self) -> list[Class]

Method

def name(self) -> str: ...
def text(self) -> str:
def start_line(self) -> int:
def end_line(self) -> int:
def length(self):
def lines(self) -> dict[int, str]:
def body_node(self) -> Node | None:
def body_start_line(self) -> int:
def body_end_line(self) -> int:
def name(self) -> str: ...

def accessible_functions(self) -> list[Function]: ...
def callees(self) -> list[Function]: ...
def callers(self) -> list[Function]: ...
def calls(self) -> list[Statement]: ...
def statements(self) -> list[Statement]: ...

Statement

def text(self) -> str:
def start_line(self) -> int:
def end_line(self) -> int:
def length(self) -> int:

def forward_controls(self) -> list[Statement]:
def backward_controls(self) -> list[Statement]:
def forward_datas(self, identifier: str) -> list[Statement]:
def backward_datas(self, identifier: str) -> list[Statement]:

Patch(Commit)

def message(self) -> str:
def author(self) -> str:
def commit_date(self) -> datetime:
def author_date(self) -> datetime:
def next_commit(self) -> Commit:
def pre_commmit(self) -> Commit:

def added_files(self) -> list[File]:
def deleted_files(self) -> list[File]:

def added_imports(self) -> list[Import]:
def deleted_imports(self) -> list[Import]:

def added_classes(self) -> list[Class]:
def deleted_classes(self) -> list[Class]:

def added_methods(self) -> list[Method]:
def changed_methods(self) -> list[Method]:
def deleted_methods(self) -> list[Method]:

def added_fields(self) -> list[Field]:
def deleted_fields(self) -> list[Field]:
def changed_files(self) -> list[File]:

def merge():

Slicer

def slice(
        self,
        criteria_lines: set[int],
        criteria_identifier: dict[int, set[str]],
        backward_slice_level: int,
        forward_slice_level: int,
        ignore_control: bool
        ingore_data: bool
) -> list[int]:

def backward_slice(
        criteria_lines: set[int],
        criteria_nodes: list[PDGNode],
        criteria_identifier: dict[int, set[str]],
        all_nodes: dict[int, list[PDGNode]],
        level: int,
        ignore_control: bool
        ingore_data: bool
) -> list[int]:

def forward_slice(
        criteria_lines: set[int],
        criteria_nodes: list[PDGNode],
        criteria_identifier: dict[int, set[str]],
        all_nodes: dict[int, list[PDGNode]],
        level: int,
        ignore_control: bool
        ingore_data: bool
) -> list[int]:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scubatrace-0.5.1.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scubatrace-0.5.1-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file scubatrace-0.5.1.tar.gz.

File metadata

  • Download URL: scubatrace-0.5.1.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for scubatrace-0.5.1.tar.gz
Algorithm Hash digest
SHA256 a74b75180c341965fe6b00296283387a683be37ad82875919b01e9df21e09d25
MD5 67a009b6527a9d4dff76489cbed2e039
BLAKE2b-256 43d435330f1bd981a3b128211d6ed34643a0b9725d3beea3599dff70c550e6ef

See more details on using hashes here.

File details

Details for the file scubatrace-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: scubatrace-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for scubatrace-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56776acf4a2c6244e1249ff72768b991d7a6d1a48e49c9eca9ff016d7af3d4fe
MD5 02379805025483d992780dba664350b3
BLAKE2b-256 f72ac0d97cb6bfb2368a1e679d7f21d5dd83a56268cd8531044480f98e57bb05

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page