prism-code-workspace 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prism_code_workspace-1.0.0.dist-info/METADATA +272 -0
- prism_code_workspace-1.0.0.dist-info/RECORD +30 -0
- prism_code_workspace-1.0.0.dist-info/WHEEL +4 -0
- prism_code_workspace-1.0.0.dist-info/entry_points.txt +3 -0
- prism_code_workspace-1.0.0.dist-info/licenses/LICENSE +21 -0
- python_app/__init__.py +3 -0
- python_app/ai.py +225 -0
- python_app/analysis.py +953 -0
- python_app/compare.py +685 -0
- python_app/compare_engine.py +284 -0
- python_app/compiled_analysis.py +727 -0
- python_app/desktop.py +181 -0
- python_app/function_pov/__init__.py +16 -0
- python_app/function_pov/analyzer.py +464 -0
- python_app/function_pov/graph.py +50 -0
- python_app/function_pov/models.py +53 -0
- python_app/function_pov/pov/__init__.py +17 -0
- python_app/function_pov/pov/engine.py +1630 -0
- python_app/function_pov/pov/exercises.py +1263 -0
- python_app/function_pov_ui.py +1749 -0
- python_app/i18n.py +570 -0
- python_app/installer.nsi +70 -0
- python_app/installer_runtime.nsi +70 -0
- python_app/js_analysis.py +709 -0
- python_app/launch.py +6 -0
- python_app/launch_native.py +14 -0
- python_app/metrics_advisor.py +79 -0
- python_app/native_app.py +1709 -0
- python_app/requirements.txt +7 -0
- python_app/server.py +453 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Function call graph data derived from static analysis results."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import asdict, dataclass
|
|
4
|
+
from typing import Dict, Tuple
|
|
5
|
+
|
|
6
|
+
from .models import AnalysisResult
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class GraphNode:
|
|
11
|
+
id: str
|
|
12
|
+
label: str
|
|
13
|
+
module: str
|
|
14
|
+
file: str
|
|
15
|
+
line: int
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class GraphEdge:
|
|
20
|
+
source: str
|
|
21
|
+
target: str
|
|
22
|
+
line: int
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass(frozen=True)
|
|
26
|
+
class FunctionGraph:
|
|
27
|
+
nodes: Tuple[GraphNode, ...]
|
|
28
|
+
edges: Tuple[GraphEdge, ...]
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> Dict[str, object]:
|
|
31
|
+
return asdict(self)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def build_function_graph(analysis: AnalysisResult) -> FunctionGraph:
|
|
35
|
+
"""Build serializable graph nodes and edges from an analysis result."""
|
|
36
|
+
nodes = tuple(
|
|
37
|
+
GraphNode(
|
|
38
|
+
id=function.id,
|
|
39
|
+
label=function.name,
|
|
40
|
+
module=function.module,
|
|
41
|
+
file=function.file,
|
|
42
|
+
line=function.line,
|
|
43
|
+
)
|
|
44
|
+
for function in analysis.functions
|
|
45
|
+
)
|
|
46
|
+
edges = tuple(
|
|
47
|
+
GraphEdge(source=call.caller, target=call.callee, line=call.line)
|
|
48
|
+
for call in analysis.calls
|
|
49
|
+
)
|
|
50
|
+
return FunctionGraph(nodes=nodes, edges=edges)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Data models shared by the analyzer, graph builder, and CLI."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import asdict, dataclass
|
|
4
|
+
from typing import Dict, Optional, Tuple
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True)
|
|
8
|
+
class ParameterInfo:
|
|
9
|
+
name: str
|
|
10
|
+
kind: str
|
|
11
|
+
default: Optional[str] = None
|
|
12
|
+
annotation: Optional[str] = None
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(frozen=True)
|
|
16
|
+
class FunctionInfo:
|
|
17
|
+
id: str
|
|
18
|
+
name: str
|
|
19
|
+
module: str
|
|
20
|
+
file: str
|
|
21
|
+
line: int
|
|
22
|
+
end_line: int
|
|
23
|
+
source: str
|
|
24
|
+
docstring: Optional[str]
|
|
25
|
+
parameters: Tuple[ParameterInfo, ...]
|
|
26
|
+
return_expressions: Tuple[str, ...]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@dataclass(frozen=True)
|
|
30
|
+
class CallEdge:
|
|
31
|
+
caller: str
|
|
32
|
+
callee: str
|
|
33
|
+
line: int
|
|
34
|
+
expression: str
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@dataclass(frozen=True)
|
|
38
|
+
class Diagnostic:
|
|
39
|
+
file: str
|
|
40
|
+
message: str
|
|
41
|
+
severity: str
|
|
42
|
+
line: Optional[int] = None
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass(frozen=True)
|
|
46
|
+
class AnalysisResult:
|
|
47
|
+
root: str
|
|
48
|
+
functions: Tuple[FunctionInfo, ...]
|
|
49
|
+
calls: Tuple[CallEdge, ...]
|
|
50
|
+
diagnostics: Tuple[Diagnostic, ...]
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> Dict[str, object]:
|
|
53
|
+
return asdict(self)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Restricted, non-executing POV simulations."""
|
|
2
|
+
|
|
3
|
+
from .engine import (
|
|
4
|
+
PovSimulation,
|
|
5
|
+
SimulationError,
|
|
6
|
+
build_program_simulation_from_source,
|
|
7
|
+
build_simulation,
|
|
8
|
+
build_simulation_from_source,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"PovSimulation",
|
|
13
|
+
"SimulationError",
|
|
14
|
+
"build_program_simulation_from_source",
|
|
15
|
+
"build_simulation",
|
|
16
|
+
"build_simulation_from_source",
|
|
17
|
+
]
|