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.6.0.tar.gz (34.4 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.6.0-py3-none-any.whl (37.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for scubatrace-0.6.0.tar.gz
Algorithm Hash digest
SHA256 a37119ec5d02c1a433f3a197376baa5a7410f78045f933fcd3a48c5f11d8ab1c
MD5 6f8749457d2901beb393bdb330593708
BLAKE2b-256 34c7103dda147e686bb1e3b5f20cc8521fb61bbf63342eb73236164a28633e46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: scubatrace-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 37.2 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.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52cb0b7e853d182a3ab71a8ba7d9440e266a2dcb99029c07a73d2b2fd119f827
MD5 af7433c925f70a3d2924c0fe7d2bd34a
BLAKE2b-256 da74c679078f75ff70d3b201c7d39b49fb792f3fee1b3c1986ba9025e0d8d519

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